我是 Keras 的新手,我打算为每个时代存储我的网络输出。为此,我想使用 Tensorbaord 来观察其环境中的输出层。
class OutputObserver(Callback):
""""
callback to observe the output of the network
"""
def on_train_begin(self, logs={}):
self.epoch = []
self.out_log = []
def on_epoch_end(self, epoch, logs={}):
self.epoch.append(epoch)
self.out_log.append(self.model.get_layer('Dense03/Output').output)
Run Code Online (Sandbox Code Playgroud)
这会将输出张量存储到列表中。问题是我不能做 1. 将其转换为 Numpy 数组,以便可以读取 CSV,...文件,2. 使用 Tensorflow 编写摘要(因为 Keras 没有这种能力),然后分析输出在张量板中。
我很高兴听到您对在每个训练时期存储和可视化输出层的意见。
真诚的,赛义德。