[英]How to print weights and bias during training after each epoch
How to print the weights and bias in a neural network after each epoch during training 训练期间每个时期后如何在神经网络中打印权重和偏差
I have tried the following code: 我尝试了以下代码:
print_weights = LambdaCallback(on_epoch_end=lambda epoch, logs: print(merged.layers[1].get_weights()[0][0:5], merged.layers[2].get_weights()[0][0:5]))
merged.compile(optimizer='adam',loss=[loss1, loss2],loss_weights=[alpham, 1 - alpham], metrics=['accuracy'],callbacks = [print_weights])
But I am getting the following error: 但是我收到以下错误:
ValueError: ('Some keys in session_kwargs are not supported at this time: %s', dict_keys(['callbacks'])) ValueError :(目前不支持session_kwargs中的某些键:%s',dict_keys(['callbacks']))
model.compile
不接受提供给model.fit
的回调。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.