随笔分类 - 1_4pytorch
pytorch(3-2) 多层 线性回归 训练和预测代码
摘要:脱离网页化python 没有可视化 代码没有加入可视化图 需要的化参考 https://www.cnblogs.com/gooutlook/p/17729064.html 无可视化版本 #%matplotlib inline import torch import torchvision from
阅读全文
pytorch(3) 单层线性回归 训练和预测代码
摘要:import torch import matplotlib.pyplot as plt torch.manual_seed(10) lr = 0.05 # 学习率 # 创建训练数据 x = torch.rand(20, 1) * 10 # x data (tensor), shape=(20, 1
阅读全文
pytorch(5) 多项式回归 模型选择、欠拟合和过拟合
摘要:import math import numpy as np import torch from torch import nn from d2l import torch as d2l max_degree = 20 # 多项式的最大阶数 n_train, n_test = 100, 100 #
阅读全文
pytorch(2) softmax回归
摘要:https://tangshusen.me/Dive-into-DL-PyTorch/#/chapter03_DL-basics/3.4_softmax-regression ''' softmax 将未规范化的预测变换为非负数并且总和为1 我们首先对每个未规范化的预测求幂,这样可以保证输出非负。
阅读全文
pytorch(3)损失函数
摘要:1 损失函数 | Mean-Squared Loss https://zhuanlan.zhihu.com/p/35707643 2 交叉熵损失函数 https://www.zhihu.com/tardis/zm/art/35709485?source_id=1003
阅读全文
pytorch(1)安装
摘要:https://pytorch.org/get-started/locally/ 创建环境 conda create -n pytorch python=3.9 激活 activate pytorch 安装pytorch https://pytorch.org/ 根据cuda的版本 pip inst
阅读全文
pytorch(0) 学习资料
摘要:资源 1 初始学习阶段,主要框架看1,到VGG和残差网络那,然后交叉看2的讲解更清晰 2 后续,2讲解的对抗网络等,1没有发现,后面两个同步对着看吧。 百度脑图笔记 https://naotu.baidu.com/file/608fb4d49c8c5b493f3f5d5934c8e444 1 主线教
阅读全文