Hi all,
I want to pre-train some layers with an autoencoder for my task. The forward pass is described below:
def forward(self, InputData):

    ConvTensor = self.Conv1D_L1(InputData)
    ReLUTensor = self.LeakyReLU_L2(ConvTensor)
    BatchNormTensor = self.BatchNorm1D_L3(ReLUTensor)
    MaxPooledTensor, Indices = self.MaxPool1D_L4(BatchNormTensor)
    MaxUnPooledTensor = self.MaxUnPool1D_L5(MaxPooledTensor, Indices)
    Output = self.Conv1DTransposed_L6(MaxUnPooledTensor)

    return Output

I am only interested in the first to the fourth layers and from my knowledge, only layer 1 and layer 3 have trainable parameters and I should only extract their parameters but however, I get 6 tensors when I call Model.parameters(). I have consulted the documentation regarding the trainable parameters for other layers but couldn’t understand/have been yet to able to find any information. Hence my questions:


When I extract the parameters of the trained layers, should I extract the parameters of only layers 1 and 3 or should I extract the parameters of layers 1-4?


Would it be sufficient to just use Layer.parameters() or should I separately extract the weights and biases using Layer.weight and Layer.bias?