Part 7 (10 points, coding task)
In this part, you are asked to create the dataset \mathcal D_{BC}.
-
Define dataset \mathcal D_{BC} in the way that for each \left( t, x \right) \in \mathcal D_{BC}, x is either 0 or 1, and t is evenly sampled from \left\{ 0, 0.01, 0.02, \cdots , 0.98, 0.99, 1 \right\}. Therefore, | \mathcal D_{BC} | = 2 \cdot 101 = 202.
-
The dataset shall be a tensor with name
dataset_train_BC
and shape(202,2)
. -
Set
dataset_train_BC.requires_grad = True
. -
Print
dataset_train_BC.requires_grad
anddataset_train_IC.shape
.