51序列模型
import torch
from torch import nn
from d2l import torch as d2l
import matplotlib.pyplot as pltT 1000 # 总共产生1000个点
time torch.arange(1, T 1, dtypetorch.float32)
x torch.sin(0.01 * time) torch.normal(mean0, std0.2, size(T,))
d2l.plot(…
构造代码块
特点:优先于构造方法执行,每new一次,就会执行一次
public class Person {public Person(){System.out.println("我是无参构造方法");}{System.out.println("我是构造代码块"); //构造代码块}
}public class Test {public stati…