摘要: 参考自https://zhuanlan.zhihu.com/p/279903361,原始来自:https://towardsdatascience.com/how-to-use-pytorch-hooks-5041d777f904 在Module官方文档那片笔记中已经有一部分关于hook的介绍了,但 阅读全文
posted @ 2022-11-05 21:07 X-ocean 阅读(136) 评论(0) 推荐(0)
摘要: https://pytorch.org/tutorials/recipes/recipes/saving_and_loading_a_general_checkpoint.html 保存和加载checkpoints很有帮助。 为了保存checkpoints,必须将它们放在字典对象里,然后使用torc 阅读全文
posted @ 2022-11-05 20:47 X-ocean 阅读(446) 评论(0) 推荐(0)
摘要: 来自: https://pytorch.org/tutorials/recipes/recipes/what_is_state_dict.html 在PyTorch中,可学习的参数都被保存在模型的parameters中,可以通过model.parameters()访问到。而state_dict则是一 阅读全文
posted @ 2022-11-05 20:35 X-ocean 阅读(177) 评论(0) 推荐(0)
摘要: 来自https://pytorch.org/docs/stable/notes/modules.html A Simple Custom Module import torch from torch import nn class MyLinear(nn.Module): def __init__( 阅读全文
posted @ 2022-11-05 17:52 X-ocean 阅读(147) 评论(0) 推荐(1)