笔记整理
代码整理
L2 范数正则化(regularization)
%matplotlib inline
import torch
import torch.nn as nn
import numpy as np
import sys
sys.path.append(/home/kesci/input)
import d2lzh1981 as d2l
# L2范数正则化
def fit_and_plot_pytorch(wd):
# 对权重参数衰减。权重名称一般是以weight结尾
net = nn.Linear(num_inputs, 1)
nn.init
2021-11-17 14:31:48
765KB
c
num
OR
1