Thank you very much for the reply. The reason I was doing it this way was so that I could easily access the encoder model once it was trained for further supervised training. Is it better to structure my model as you have and then at the end recover the supervised model with:
supervised_model = unsupervised_model.encoder?