简体   繁体   中英

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']))

model.compile不接受提供给model.fit的回调。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM