【发布时间】:2018-10-19 20:03:07
【问题描述】:
我有以下代码(使用 Keras):
self.tensorboard = TensorBoard(log_dir='./logs', histogram_freq=0,
write_graph=False, write_images=True)
input_ = Input(shape=self.s_dim, name='input')
hidden = Dense(self.n_hidden, activation='relu')(input_)
out = Dense(3, activation='softmax')(hidden)
model = Model(inputs=input_, outputs=out, name="br-model")
model.compile(loss='mean_squared_error', optimizer=SGD(lr=0.005), metrics=['accuracy'])
# Some stuff in-between
model.fit(batch, target, epochs=2, verbose=0, callbacks=[self.tensorboard])
for k in batch:
exploitability.append(np.max(model.predict(batch[k]))
它绘制了张量板的损失和准确性。
但我也想将np.average(exploitabilty) 绘制到张量板上——它是如何工作的?是否有可能将其作为指标或类似的东西传递?
【问题讨论】:
标签: python tensorflow machine-learning keras tensorboard