Trainable parameters in CGConv? #3147
-
Hi! I'm using a CGConv layer in a model, and I thought I understood this kind of layer, but in trying to find the number of trainable parameters, I realise that I don't. Here is how I define my model: nNodeFeatures = 55 self.graphconv = CGConv( nNodeFeatures, dim = nEdgeFeatures ) Then I pass the output of this layer through a linear layer: self.linear = Linear( nNodeFeatures, 1 ) With a model defined with just these two layers, I now loop over the parameters, and I get the following: for param in model.parameters(): This is what I get, and what prompts my question: torch.Size([55, 111]) True <--- Matrix Wf (I understand) So, my question is: there appear to be two additional trainable tensors that I cannot figure out from the documentation on CGConv; just for my peace of mind, I would like to understand what these are. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
self.bn = BatchNorm1d(channels[1])
this line in CGConvs init, gets executed even ifbatch_norm
variable isfalse
, but in forwardsefl.bn
gets applied only ifself.batch_norm
is true.So the two parameters of size 55, are the two trainable parameters of batch norm, but these parameters don't get trained because they aren't used in the networks forward pass.
I'll create a PR to fix this in master in a while.