Skip to content

Commit

Permalink
Fixed typos in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhanrahmanian committed Mar 16, 2024
1 parent 468949d commit 102790d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions arcana/procedures/finetuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,15 @@ def load_model(self):


def unfreeze_decoder(self):
"""Freeze the encoder"""

list_to_unfreeze = ["encoder.lstm.weight_ih_l2",
"encoder.lstm.weight_hh_l2",
"encoder.lstm.bias_ih_l2",
"encoder.lstm.bias_hh_l2"]

"""Unfreeze the encoder"""
for param in self.pretrained_model.parameters():
param.requires_grad = False
for name, param in self.pretrained_model.named_parameters():
if name in list_to_unfreeze:
param.requires_grad = True
for _, param in self.pretrained_model.decoder.named_parameters():
param.requires_grad = True


def unfreeze_fully_connected(self):
"""Freeze the fully connected layer"""
"""Unfreeze the fully connected layer"""
for param in self.pretrained_model.parameters():
param.requires_grad = False
for param in self.pretrained_model.decoder.fc_layer_pred_1.parameters():
Expand Down

0 comments on commit 102790d

Please sign in to comment.