Example

Instantiating SyntheticRegressionData

Once the SyntheticRegressionData class is defined, we can instantiate it with predefined ground truth parameters to create our synthetic dataset. For example, by specifying the true weight vector as w=[2,3.4]op\mathbf{w} = [2, -3.4]^ op and the bias as b=4.2b = 4.2, the resulting data object will store the generated features and labels. Inspecting an individual data point from this instantiated object, such as the first entry, will return a feature vector in R2\mathbb{R}^2 and its corresponding computed scalar label.

0

1

Updated 2026-05-02

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L