HessMaxEV

class cockpit.quantities.HessMaxEV(track_schedule, verbose=False, use_power=True)[source]

Quantity Class tracking the Hessian’s largest eigenvalue.

Initialization sets the tracking schedule & creates the output dict.

Parameters
  • track_schedule (callable) – Function that maps the global_step to a boolean, which determines if the quantity should be computed.

  • verbose (bool, optional) – Turns on verbose mode. Defaults to False.

  • use_power (bool) – If True, uses a power iteration that works on GPUs. If True, use scipy.sparse.linalg.eigsh() for eigenvalue computation (requires transfers from GPU to CPU and torch to numpy.)