『PyTorch』第四弹_通过LeNet初识pytorch神经网络_上 # Author : Hellcat # Time : 2018/2/11 import torch as t import torch.nn as nn import torch.nn.functional as F class LeNet(nn.Module): def __init__(self): super(LeNet,self).__init__() self.conv1 = nn.Conv2d(3, 6, 5)
论文地址:http://www.iro.umontreal.ca/~vincentp/Publications/lm_jmlr.pdf 论文给出了NNLM的框架图: 针对论文,实现代码如下: # -*- coding: utf-8 -*- # @time : 2019/10/26 12:20 import numpy as np import torch import torch.nn as nn import torch.optim as optim from torch.autograd i