After running this example dcg code
which randomly chooses the number of hidden layers [0, 3] each iteration, I printed the parameters in the network with print [x for x in model.parameters()]
and it only shows the original nn.modules.
[Parameter containing:
0.0682 -0.0155 -0.3447
0.1916 -0.1639 0.1732
[torch.FloatTensor of size 2x3]
, Parameter containing:
0.0412
-0.3786
[torch.FloatTensor of size 2]
, Parameter containing:
0.3711 0.2467
-0.4274 0.6104
[torch.FloatTensor of size 2x2]
, Parameter containing:
0.5531
0.0944
[torch.FloatTensor of size 2]
, Parameter containing:
0.0678 -0.4616
[torch.FloatTensor of size 1x2]
, Parameter containing:
0.2338
[torch.FloatTensor of size 1]
]
It doesn’t show the dynamic layers used during training. Question: how does pytorch store the dynamic parameters? Are the dynamic parameters used during inference?