title: Transfer Learning - How can I change only the output layer in TensorFlow?
body: <p>I am trying to apply one idea proposed by Rusu et al. in <a href="https://arxiv.org/pdf/1511.06295.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1511.06295.pdf</a>, which consists in training a NN changing the output layer according to the class of the input, i.e., provided that we know the id of the input, we would pick the corresponding output layer. This way, all the hidden layers would be trained with all the data, but each output layer would only be trained with its corresponding type of input data.</p>
  
  <p>This is meant to achieve good results in a transfer learning framework.</p>
  
  <p>How can I implement this "change of the last layer" in tensorflow 2.0?</p>