摘要: 参考:https://blog.csdn.net/qq_38253797/article/details/116847588 import torch import torch.nn as nn import torch.nn.functional as F import numpy as np d 阅读全文
posted @ 2022-04-14 20:50 dangxusheng 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 参考url: https://mathpretty.com/12509.html 在调试过程中, 有时候我们需要对中间变量梯度进行监控, 以确保网络的有效性, 这个时候我们需要打印出非叶节点的梯度, 为了实现这个目的, 我们可以通过两种手段进行, 分别是: retain_grad() hook re 阅读全文
posted @ 2022-04-14 20:49 dangxusheng 阅读(611) 评论(0) 推荐(1) 编辑