1.穷举线性回归1 Prepare the train set.2 Define the model3 Define the loss function4 come to train5 come to plot
import numpy as npimport matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3D1 Prepare the train set.# 数据集x_data = [1.0, 2.0, 3.0]y_data = [2.0, 4.0, 6.0]2 Define the model# 正向传播def forward(x): return x * w + b3 Define the loss