Skip to content

fix: Correct learning rate update in optimizer, reconstruction and surrogate

Lorenzo Asfour requested to merge lasfour/calo-opt:main into main

Fix Learning Rate Update

Description

This merge request fixes the issue where the learning rate was incorrectly updated in multiple methods by directly assigning to self.optimizer.lr, which did not affect the actual learning rate used by the optimizer. The correct approach is to update the learning rate in the optimizer's parameter groups.

Affected Methods

  • Optimizer.optimize method in optimizer.py
  • Surrogate.train_model method in surrogate.py
  • Reconstruction.train_model method in reconstruction.py

Changes Made

  • Iterated over self.optimizer.param_groups and set param_group['lr'] = lr to properly update the learning rate in each affected method.

Merge request reports

Loading