enable multiple schedulers
@@ -43,7 +43,7 @@ TOKENIZER_CLASS.update(
MAX_SEQ_LEN = 512
logger = logging.getLogger(__name__)
-fh = logging.FileHandler("abssum_train.log")
+fh = logging.FileHandler("longer_input_abssum_train.log")
logger.addHandler(fh)
logger.setLevel(logging.INFO)
@@ -292,12 +292,17 @@ class Transformer:
accum_loss = 0
train_size = 0
start = end
+ if optimizer:
if type(optimizer) == list:
for o in optimizer:
o.step()
else:
optimizer.step()
if scheduler:
+ if type(scheduler) == list:
+ for s in scheduler:
+ s.step()
+ else:
scheduler.step()
self.model.zero_grad()
