随笔分类 - PyTorch学习
摘要:基于PyTorch框架的多层全连接神经网络实现MNIST手写数字分类 简单的三层全连接神经网络 导入了PyTorch相关的库,定义了一个名为SimpleNet的类,继承自nn.Module,这个神经网络有三个全连接层,分别是layer1、layer2和layer3。在初始化函数__init__中,指
阅读全文
摘要:线性回归 一维线性回归 最小二乘法,偏导数为0 import torch from torch.autograd import Variable import matplotlib.pyplot as plt import numpy as np import torch.nn as nn impo
阅读全文
摘要:梯度下降 BGD def batchGradientDescent(x, y, theta, alpha, m, maxInteration): '''批梯度下降算法简单实现 x: 输入 y: 输出 theta: w 和 b 组成的向量 alpha: 学习率 m: 批数据数量 maxInterati
阅读全文

浙公网安备 33010602011771号