![](https://img-blog.csdnimg.cn/20190927151053287.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Pytorch
Pytorch使用经验
lemonade117
这个作者很懒,什么都没留下…
展开
-
pytorch搭建CNN
1.直接import torch.nn as nnimport torch.nn.functional as Fclass Net(nn.Module): def __init__(self): super(Net, self).__init__() # 1 input image channel, 6 output channels, 3x...原创 2020-02-18 17:40:26 · 533 阅读 · 0 评论 -
Pytorch中, torch.einsum
https://blog.csdn.net/a2806005024/article/details/964628273)Torch矩阵乘法。print(a_tensor) tensor([[11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34], [41, 42, 43, 44]]) ...转载 2020-05-02 17:17:57 · 944 阅读 · 0 评论 -
Pytorch使用autograd.Function自定义拓展神经网络
我们知道CNN这类人工神经网络都基于BP算法进行优化,因此需要误差关于权重是连续可导的,这是可以运用BP算法的前提条件;也有一些网络不满足这个条件。1.可导对于可连续求导的神经网络构建时采用nn.Module类即可,此时仅仅需要改写__init__和forward方法,torch会自动求导,如下面的例子:import torchimport torch.nn as nnimp...原创 2020-02-17 21:05:50 · 1167 阅读 · 0 评论