我正在研究可解释的人工智能,通过观察权重中的模式作为模型超参数和输入数据的函数。我正在研究的一件事是,在学习完成之后,权重是如何从随机性(或初始值)发展到稳定的。我不想在每一个时代都节省重量,而是在每隔一次或第三次向前传球时将它们保存下来。我该怎么做?我必须将“周期”参数调整为Keras模型检查点方法吗?如果是这样的话,有什么简单的公式来设置这个论点呢?祝你愉快的一天。
发布于 2022-05-18 17:59:26
实例化save_freq=3时只需传递tf.keras.callbacks.ModelCheckpoint。
引用文档的话:
https://keras.io/api/callbacks/model_checkpoint/
save_freq: 'epoch' or integer. When using 'epoch', the callback saves the model after each epoch. When using integer, the callback saves the model at end of this many batches. If the Model is compiled with steps_per_execution=N, then the saving criteria will be checked every Nth batch. Note that if the saving isn't aligned to epochs, the monitored metric may potentially be less reliable (it could reflect as little as 1 batch, since the metrics get reset every epoch). Defaults to 'epoch'.https://stackoverflow.com/questions/72291894
复制相似问题