def on_epoch_end(self, epoch, logs=None):
"""Called at the end of an epoch.
# Arguments
epoch: integer, index of epoch.
logs: dictionary of logs.
"""
if epoch % self.per_epoch == 0:
weights = self.model.get_weights()[0]
# weights /= np.max(np.abs(weights))
weights = unitmatrix(weights, axis=0) # normalize
# weights[np.abs(weights) < 1e-2] = 0
heatmap(weights.T, '%s_%s%s'%(self.filename, epoch, self.ext))
评论列表
文章目录