莫烦pytorch(15)——过拟合

1.构造数据集 import matplotlib.pyplot as plt N_SAMPLES = 20 N_HIDDEN = 300 x=torch.unsqueeze(torch.linspace(-1,1,N_SAMPLES),1) y=x+0.3*torch.normal(torch.zeros(N_SAMPLES,1),torch.ones(N_SAMPLES,1)) # tes
相关文章
相关标签/搜索