If I’m not mistaken, you are passing the inputs first to the Autoencoder and pass this output to the CNN.
The code for this looks generally alright and you wouldn’t need to use two losses, if your complete model only returns a single output.
Note that the last linear layers are used without any non-linearly, which could be reduced to a single linear transformation, so you might want to add some activation function between them.


As described, it depends on your use case, but the current model definition would not need two separate loss functions. You could of course use the Autoencoder output to calculate an auxiliary loss, but that’s up to you.


The learning rate is a hyperparameter and it is expected that your model performance suffers from a bad learning rate value. E.g. if you set it to an unreasonably high values such as 1000 your model would most likely not converge.


PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.