anchor.diff:            ! compute gradient  of the cost function
             call cost_compute_gradient(fdata,fmodel,lambda,prm,grd)
   
  -          if(.not. fixed_gamma) then
  -             gamma1 = real(iter)/real(iter+10)
  -             gamma2 = real(iter)/real(iter+10)
  -          end if
  -
             select case(trim(algorithm))
             case('gd')
                prm = prm - eps_map * grd
  
positive.code:              prm2 = gamma2*prm2 + (1.0_kflt - gamma2) * grd**2
               prm = prm - eps_map * (prm1 / (1.0_kflt - gamma1**(iter+1))) / &
                    (sqrt(prm2 / (1.0_kflt - gamma2**(iter+1))) + 1.e-8_kflt)
            case default
               prm1 = gamma1*prm1 + (1.0_kflt - gamma1) * grd
               prm2 = gamma2*prm2 + (1.0_kflt - gamma2) * grd**2
  
negative.code:     real(kflt)                      :: facc
      real(kflt)                      :: grd_nrm ! grd_nrm to be minimized; magnitude of the gradient
      real(kflt)                      :: max_err
      real(kflt),parameter            :: gamma1=0.9_kflt,gamma2=0.999_kflt
      logical                         :: fixed_gamma = .true.
      real(kflt)                      :: g1,g2
      integer, parameter              :: nt0=10
  
  
      dim1 = nvars*nclasses
  