Is there a way to iterate over all modules of a model, let’s call it
Generator, and equip all
ConvTranspose2d-layers with spectral normalization?
Sorry, if this has been discussed already, I couldn’t find it though…
Many thanks in advance!
Is that a valid solution? How can you check if Conv-layer is equiped with spectral norm?
# Make all layers to be spectral normalization layer
if isinstance(m, (nn.Conv2d, nn.ConvTranspose2d)):
This is the correct anwer.
You can simply verify it by checking