I have an image encoder and a question encoder branch combined together than connecting to 2 fc layers. How should I add the parameter together to update the network parameter?
I have tried some code:
params = model.img_encoder.fc.parameters() + model.qu_encoder.parameters() + \
             model.fc1.parameters() + model.fc2.parameters()

optimizer = optim.Adam(params, lr=1e^-3)

but it will return
TypeError: unsupported operand type(s) for +: 'generator' and 'generator'

any idea or suggestion how to update the parameters of the combined network?