allenai / bilm-tf

Tensorflow implementation of contextualized word representations from bi-directional language models
Apache License 2.0
1.62k stars 452 forks source link

how to freeze some layers during training #231

Open renukachittimalla opened 4 years ago

renukachittimalla commented 4 years ago

I am trying to train ELMO on small dataset and want to freeze all the top layers i.e., cnn,highway network layers and 1st LSTM. I am using restart.py to retrain and i don't have a clue how to freeze these layers. Can you please help me . Thanks

eduamf commented 4 years ago

To freeze a layer is to fix the weights. This can be done with trainable=False when setting a variable. It`s a clue.