Pytorch
haoxue2011
这个作者很懒,什么都没留下…
展开
-
pytorch: register_hook
register_hook 是 torch.tensor 的 属性 register_forward_hook 和 register_backward_hook 是 torch.nn.Module 的属性原创 2020-09-07 15:50:19 · 278 阅读 · 0 评论 -
torch.mean()
torch.mean(tensor, dim=0) dim 表示的是 沿着 dim 维度进行 求平均值原创 2020-09-01 19:37:20 · 4539 阅读 · 0 评论 -
mmdetection V2.0 安装
系统环境 Ubuntu 18.04 + gcc 7.5 + cuda 10.1 + cudnn 1. 查看cuda版本 cat /usr/local/cuda/version.txt 需要提前安装的包 1. Anaconda python=3.7 2. pip install pycocotools 3. pip install cpython 4. conda install pytorch=1.4 cudatoolkit=10.1 torchvision -c pytorch 不要安装 pytor原创 2020-06-21 21:18:40 · 850 阅读 · 0 评论 -
pytorch autograd
pytorch autograd 自动求导机制 Internally, autograd represents this graph as a graph of Function objects (really expressions), which can be apply() ed to compute the result of evaluating the graph. When com...原创 2020-03-23 21:28:56 · 125 阅读 · 0 评论 -
pytorch autograd: torch.nn.Function
https://pytorch.org/docs/stable/notes/extending.html # Inherit from Function class LinearFunction(Function): # Note that both forward and backward are @staticmethods @staticmethod # bias ...原创 2020-03-23 18:52:56 · 166 阅读 · 0 评论 -
torch.nn modules
torch.nn from torchvision.models import resnet18 net = resnet18() for i, m in enumerate(net.modules()): print(i, m) self.modules()是递归的原创 2020-03-23 11:00:56 · 212 阅读 · 0 评论 -
Pytorch的bakcward()多个loss函数
Pytorch的backward()函数 假若有多个loss函数,如何进行反向传播和更新呢? x = torch.tensor(2.0, requires_grad=True) y = x**2 ...原创 2019-10-14 08:34:40 · 7298 阅读 · 0 评论