【机器学习入门】线性回归算法的pytorch实现及过程可视化
import torch as tfrom matplotlib import pyplot as pltimport numpy as npt.manual_seed(1000) # 随机种子def get_fake_data(batch_size=8): # 产生噪声数据 x = t.rand(batch_size, 1) * 20 noise = t.randn(batch_size, 1) y = x * 2 + (1 + noise) * 3 # y
原创
2020-06-23 19:38:04 ·
2787 阅读 ·
0 评论