code: def update(self,iiter,H,Y,eta,loss):
          
          if iiter <= self.niter_trace+1:
              self.H[iiter] = H
              self.Y[iiter] = Y
          elif iiter >self.niter - self.niter_trace + 1:
              self.H[self.ltrace+iiter-self.niter-1] = H
              self.Y[self.ltrace+iiter-self.niter-1] = Y
  
          self.etas[iiter] = eta
          self.loss[iiter] = loss
          if self.loss[iiter] < self.lmin:
              self.Yh = Y
              self.lmin = self.loss[iiter]
              self.miniter = iiter if not iiter == -1 else self.niter + 1
docs: Update the trace_var in new iteration