
pytorch
小白马突突突
我年轻的时候,也曾快马加鞭,看尽长安花
展开
-
pytorch 深度学习入门代码 (一)线性回归代码实现
"""一维线性回归代码实现"""import torchfrom torch.autograd import Variableimport matplotlib.pyplot as pltimport torch.nn as nnimport torch.optim as optimimport numpy as npclass LinearRegression(nn.Modu...原创 2018-07-30 20:02:38 · 1905 阅读 · 1 评论 -
pytorch 深度学习入门代码 (二)多项式回归代码实现
"""多项式回归代码实现"""import torchfrom torch.autograd import Variableimport torch.nn as nnimport torch.optim as optimimport matplotlib.pyplot as pltimport numpy as npdef make_features(x): """Bu...原创 2018-07-30 20:11:01 · 1721 阅读 · 0 评论 -
pytorch 深度学习入门代码 (三)Logistic 回归代码实现
"""Logistic 回归的代码实现"""import matplotlib.pyplot as pltimport torchimport torch.nn as nnfrom torch.autograd import Variableimport numpy as npclass LogisticRegression(nn.Mo原创 2018-07-30 20:16:34 · 2347 阅读 · 0 评论 -
pytorch 深度学习入门代码 (四)多层全连接神经网络实现 MNIST 手写数字分类
net.pyimport torch.nn as nnclass SimpleNet(nn.Module): def __init__(self, in_dim, n_hidden_1, n_hidden_2, out_dim): super(SimpleNet, self).__init__() self.layer1 = nn.Sequentia...原创 2018-07-31 20:43:01 · 4990 阅读 · 2 评论 -
pytorch 深度学习入门代码 (五)多层卷积神经网络实现 MNIST 手写数字分类
cnn.pyimport torch.nn as nnclass CNN(nn.Module): def __init__(self): super(CNN, self).__init__() self.layer1 = nn.Sequential( nn.Conv2d(1, 16, kernel_size=3), ...原创 2018-08-01 19:41:53 · 1794 阅读 · 0 评论