How to get weights in tf.layers.dense?

前端 未结 7 694
悲哀的现实
悲哀的现实 2020-12-29 07:25

I wanna draw the weights of tf.layers.dense in tensorboard histogram, but it not show in the parameter, how could I do that?

相关标签:
7条回答
  • 2020-12-29 07:58

    In TF 2 if you're inside a @tf.function (graph mode):

    weights = optimizer.weights

    If you're in eager mode (default in TF2 except in @tf.function decorated functions):

    weights = optimizer.get_weights()

    0 讨论(0)
提交回复
热议问题