Learn Before
Concept
Targeted Parameter Access in MXNet
In MXNet, the underlying numerical values of a parameter object are accessed by calling the .data() method. Similarly, the gradients associated with the parameter can be retrieved by invoking the .grad() method. For instance, net[1].bias.data() extracts the numerical value of the bias from a specific layer, while net[1].weight.grad() accesses the gradient of its weights.
0
1
Updated 2026-05-08
Tags
D2L
Dive into Deep Learning @ D2L