layers = self.model.layers
for layer in layers:
if hasattr(layer, "W"):
tf.histogram_summary("{}_W".format(layer.name), layer.W)
if hasattr(layer, "b"):
tf.histogram_summary("{}_b".format(layer.name), layer.b)
if hasattr(layer, "output"):
After Change
if len(shape) > 1 and shape[0] > shape[1]:
w_img = tf.transpose(w_img)
if len(shape) == 1:
w_img = tf.expand_dims(w_img, 0)
w_img = tf.expand_dims(tf.expand_dims(w_img, 0), -1)
tf.image_summary(weight.name, w_img)