1- from pathlib import Path
2-
31import numpy as np
42import torch as th
53import torch .nn as nn
@@ -106,18 +104,22 @@ def main():
106104 optimizer .step ()
107105 optimizer .zero_grad (set_to_none = True )
108106
109- preds = th .argmax (logits , dim = 1 )
110- metrics (y , preds )
107+ metrics (y , logits )
111108
112109 break
113110 print (metrics .accumulate ())
114111 print ("Dry run completed successfully." )
115- exit (0 )
116-
117- wandb .login (key = WANDB_API )
118- wandb .init (entity = "ColabCode" , project = "Jan" , tags = [args .modelname , args .dataset ])
112+ exit ()
113+
114+ # wandb.login(key=WANDB_API)
115+ wandb .init (
116+ entity = "ColabCode-org" ,
117+ # entity="FYS-8805 Exam",
118+ project = "Test" ,
119+ tags = [args .modelname , args .dataset ]
120+ )
119121 wandb .watch (model )
120-
122+ exit ()
121123 for epoch in range (args .epoch ):
122124 # Training loop start
123125 trainingloss = []
@@ -133,8 +135,7 @@ def main():
133135 optimizer .zero_grad (set_to_none = True )
134136 trainingloss .append (loss .item ())
135137
136- preds = th .argmax (logits , dim = 1 )
137- metrics (y , preds )
138+ metrics (y , logits )
138139
139140 wandb .log (metrics .accumulate (str_prefix = "Train " ))
140141 metrics .reset ()
@@ -149,8 +150,7 @@ def main():
149150 loss = criterion (logits , y )
150151 evalloss .append (loss .item ())
151152
152- preds = th .argmax (logits , dim = 1 )
153- metrics (y , preds )
153+ metrics (y , logits )
154154
155155 wandb .log (metrics .accumulate (str_prefix = "Evaluation " ))
156156 metrics .reset ()
0 commit comments