title: How to freeze TFBertForSequenceClassification pre trained model?
body: <p>If I am using the tensorflow version of huggingface transformer, how do I freeze the weights of the pretrained encoder so that only the weights of the head layer are optimized?</p>
  <p>For the PyTorch implementation, it is done through</p>
  <pre><code>for param in model.base_model.parameters():
      param.requires_grad = False
  </code></pre>
  <p>Would like to do the same for tensorflow implementation.</p>