Update.
authorFrançois Fleuret <francois@fleuret.org>
Mon, 29 Jul 2024 08:16:09 +0000 (10:16 +0200)
committerFrançois Fleuret <francois@fleuret.org>
Mon, 29 Jul 2024 08:16:09 +0000 (10:16 +0200)
main.py
mygpt.py

diff --git a/main.py b/main.py
index e553278..0d4cd10 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -453,11 +453,13 @@ def one_epoch(model, quiz_machine, local_device=main_device):
 
 
 def model_transformer_hot(model):
-    model.temperature = args.temperature_hot
+    # model.temperature = args.temperature_hot
+    model.set_noise_injection(1.0, ("ffw", 2))
 
 
 def model_transformer_cold(model):
-    model.temperature = args.temperature_cold
+    pass
+    # model.temperature = args.temperature_cold
 
 
 c_quizzes_procedure = [
index c073113..7c51bae 100755 (executable)
--- a/mygpt.py
+++ b/mygpt.py
@@ -371,7 +371,7 @@ class MyGPT(nn.Module):
                 m.noise_std = 0.0
 
     def set_noise_injection(self, noise_std, identifier=None):
-        for m in model.modules():
+        for m in self.modules():
             if isinstance(m, NoiseInjector):
                 if identifier is None or identifier == m.identifier:
                     m.noise_std = noise_std