http://d2l.ai/chapter_deep-learning-computation/model-construction.html
In the MySequential
class section 5.1.2, it would be beneficial to the readers if it is mentioned that nn.Block
has a self._children
attribute and hence we are able to write:
self._children[block.name] = block
in the add
function.
Also, in FancyMLP
class in section 5.1.3, it would be great to advise the readers that
self.rand_weight = self.params.get_constant('rand_weight', nd.random.uniform(shape=(20, 20)))
will become clear after sections 5.2 and 5.4.