code: def AddTrainingOperators(model, softmax, label):
      
      xent = model.LabelCrossEntropy([softmax, label], 'xent')
      # compute the expected loss
      loss = model.AveragedLoss(xent, "loss")
      # track the accuracy of the model
      AddAccuracy(model, softmax, label)
      # use the average loss we just computed to add gradient operators to the
      # model
      model.AddGradientOperators([loss])
      # do a simple stochastic gradient descent
      ITER = brew.iter(model, "iter")
      # set the learning rate schedule
      LR = model.LearningRate(
          ITER, "LR", base_lr=-0.1, policy="step", stepsize=1, gamma=0.999)
      # ONE is a constant value that is used in the gradient update. We only need
      # to create it once, so it is explicitly placed in param_init_net.
      ONE = model.param_init_net.ConstantFill([], "ONE", shape=[1], value=1.0)
      # Now, for each parameter, we do the gradient updates.
      for param in model.params:
          # Note how we get the gradient of each parameter - ModelHelper keeps
          # track of that.
          param_grad = model.param_to_grad[param]
          # The update is a simple weighted sum: param = param + param_grad * LR
          model.WeightedSum([param, ONE, param_grad, LR], param)
docs: Adds training operators to the model.