Hi everyone,
i am trying to implement a model that consists of multiple encoders and one classifier.
Therefore I already implemented an Encoder as a PyTorch Model (a Class that inherits from nn.Module). I now want to implement my “Main-Model”, i.e. a model that consists of multiple Encoders and a classifier. In order to achieve this, I implemented a second class that inherits from nn.Module and passed the encoders to it as member-variables. However, if I call my_model.to(device), the encoders won’t be passed to the GPU. I think there must be a better way of assembling multiple “submodels” to one big model.
Can you tell me, what the best practice is for my problem?
Thank you!