摘要: 线性回归 一维线性回归 最小二乘法,偏导数为0 import torch from torch.autograd import Variable import matplotlib.pyplot as plt import numpy as np import torch.nn as nn impo 阅读全文
posted @ 2024-04-05 21:23 0214jx 阅读(104) 评论(0) 推荐(0)
摘要: 梯度下降 BGD def batchGradientDescent(x, y, theta, alpha, m, maxInteration): '''批梯度下降算法简单实现 x: 输入 y: 输出 theta: w 和 b 组成的向量 alpha: 学习率 m: 批数据数量 maxInterati 阅读全文
posted @ 2024-04-05 21:03 0214jx 阅读(72) 评论(0) 推荐(0)