From 99b93a2579078b12ef9685a9fa26b1d59307e635 Mon Sep 17 00:00:00 2001 From: s444501 Date: Sun, 12 Feb 2023 14:52:18 +0100 Subject: [PATCH] readme --- README.md | 14 ++++++++++++++ run_translation_freezing.py | 8 ++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a392c51 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# Transformer Encoder - RoBERTa +## Modyfikacje +1. ???? + +# Transformer Decoder - GPT-2 +## Modyfikacje +1. ???? + + +# Transformer Encoder-Decoder - T5 +## Modyfikacje +1. Zamrożenie pierwszych 20 warstw + +# Transformer w trybie few-shot/zero-shot learning - ????? \ No newline at end of file diff --git a/run_translation_freezing.py b/run_translation_freezing.py index b2e7e2b..bdeb26d 100644 --- a/run_translation_freezing.py +++ b/run_translation_freezing.py @@ -260,8 +260,12 @@ class DataTrainingArguments: def freeze_model_weights(model: torch.nn.Module) -> None: count = 0 for param in model.parameters(): - logger.info(count) - param.requires_grad = False + count += 1 + if count < 20: + logger.info(f'Freezing layer {count}') + param.requires_grad = False + else: + logger.info(f'Ignoring layer {count}') def main():