首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >每次向前传球后节省模型权重

每次向前传球后节省模型权重
EN

Stack Overflow用户
提问于 2022-05-18 15:23:12
回答 1查看 36关注 0票数 0

我正在研究可解释的人工智能,通过观察权重中的模式作为模型超参数和输入数据的函数。我正在研究的一件事是,在学习完成之后,权重是如何从随机性(或初始值)发展到稳定的。我不想在每一个时代都节省重量,而是在每隔一次或第三次向前传球时将它们保存下来。我该怎么做?我必须将“周期”参数调整为Keras模型检查点方法吗?如果是这样的话,有什么简单的公式来设置这个论点呢?祝你愉快的一天。

EN

回答 1

Stack Overflow用户

发布于 2022-05-18 17:59:26

实例化save_freq=3时只需传递tf.keras.callbacks.ModelCheckpoint

引用文档的话:

https://keras.io/api/callbacks/model_checkpoint/

代码语言:javascript
运行
复制
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'.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72291894

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档