We can print the model to see its architecture | |
thon | |
model = SimpleModel() | |
print(model) | |
This will print out the following: | |
SimpleModel( | |
(dense): Linear(in_features=10, out_features=10, bias=True) | |
(intermediate): Linear(in_features=10, out_features=10, bias=True) | |
(layer_norm): LayerNorm((10,), eps=1e-05, elementwise_affine=True) | |
) | |
We can see that the layer names are defined by the name of the class attribute in PyTorch. |