code: def on_batch_begin(self, train, **kwargs:Any)->None:
          "Record learning rate and momentum at beginning of batch."
          if train:
              self.lrs.append(self.opt.lr)
              self.moms.append(self.opt.momf on_batch_begin(self, train, **kwargs:Any)->None:
          "Record learning rate and momentum at beginning of batch."
          if train:
              self.lrs.append(self.opt.lr)
              self.moms.append(self.opt.mom)
docs: Record learning rate and momentum at beginning of batch.