anchor.diff:                        Inputs = List.empty
                         Weights = ((*) hiddenSize hiddenSize) |> listRandElems |> List.chunkBySize hiddenSize
                         Bias = listRandElems hiddenSize
  +                      Gradients = List.empty
                         PrevDeltas = List.replicate hiddenSize <| List.replicate hiddenSize 0.0
                         BiasPrevDeltas = List.replicate hiddenSize 0.0
                         NetOutputs = List.empty
  
positive.code:  let firstHiddenNetOutputs = List.map tanh firstHiddenWeightedSum
   let secondHiddenWeightedSum = weightedSum firstHiddenNetOutputs net.SecondHiddenLayer.Weights net.SecondHiddenLayer.Bias
   let secondHiddenNetOutputs = List.map tanh secondHiddenWeightedSum
  
   let outputWeightedSum = weightedSum secondHiddenNetOutputs net.OutputLayer.Weights net.OutputLayer.Bias
   let outputs = List.map tanh outputWeightedSum
   {
    net with
     FirstHiddenLayer = { net.FirstHiddenLayer with NetOutputs = firstHiddenNetOutputs }
     SecondHiddenLayer = { net.SecondHiddenLayer with NetOutputs = secondHiddenNetOutputs }
     OutputLayer = { net.OutputLayer with NetOutputs = outputs }
   }
  
  (* *** note: the previous implementation, newDeltas are used instead of prevDeltas. *)
  let backPropagate (net:Network) = (* OutputLayer->SecondHiddenLayer->FirstHiddenLayer->Inputs *)
  
   let out_grads = List.map2 (gradient deltaTanH) net.OutputLayer.NetOutputs net.TargetOutputs
   let out_deltas = deltas net.LearningRate out_grads net.SecondHiddenLayer.NetOutputs
   let out_prevDeltasWithM = List.map (smul net.Momentum) net.OutputLayer.PrevDeltas
   let out_newDeltas = List.map2 add out_deltas out_prevDeltasWithM
   let out_hidden_weights_update= List.map2 add net.OutputLayer.Weights out_newDeltas
   let out_bias_deltas = smul net.LearningRate out_grads
   let out_bias_prevDeltasWithM = smul net.Momentum net.OutputLayer.BiasPrevDeltas
   let out_bias_newDeltas = add out_bias_deltas out_bias_prevDeltasWithM
   let out_bias_update = add net.OutputLayer.Bias out_bias_newDeltas
  
   let secHidGrads = mul (List.map deltaTanH net.SecondHiddenLayer.NetOutputs) (List.map (dot out_grads) (transpose net.OutputLayer.Weights))
   let secHidDeltas = deltas net.LearningRate secHidGrads net.FirstHiddenLayer.NetOutputs
   let secHidPrevDeltasWithM = List.map (smul net.Momentum) net.SecondHiddenLayer.PrevDeltas
   let secHidNewDeltas = List.map2 add secHidDeltas secHidPrevDeltasWithM
   let secHidInputWeightsUpdate = List.map2 add net.SecondHiddenLayer.Weights secHidNewDeltas
   let secHidBiasDeltas = smul net.LearningRate secHidGrads
   let secHidBiasPrevDeltasWithM = smul net.Momentum net.SecondHiddenLayer.BiasPrevDeltas
   let secHidBiasNewDeltas = add secHidBiasDeltas secHidBiasPrevDeltasWithM
   let secHidBiasUpdate = add net.SecondHiddenLayer.Bias secHidBiasNewDeltas
  
   let firstHidGrads = mul (List.map deltaTanH net.FirstHiddenLayer.NetOutputs) (List.map (dot secHidGrads) (transpose net.SecondHiddenLayer.Weights))
   let firstHidDeltas = deltas net.LearningRate firstHidGrads net.Inputs
   let firstHidPrevDeltasWithM = List.map (smul net.Momentum) net.FirstHiddenLayer.PrevDeltas
   let firstHidNewDeltas = List.map2 add firstHidDeltas firstHidPrevDeltasWithM
   let firstHidInputWeightsUpdate = List.map2 add net.FirstHiddenLayer.Weights firstHidNewDeltas
   let firstHidBiasDeltas = smul net.LearningRate firstHidGrads
   let firstHidBiasPrevDeltasWithM = smul net.Momentum net.FirstHiddenLayer.BiasPrevDeltas
   let firstHidBiasNewDeltas = add firstHidBiasDeltas firstHidBiasPrevDeltasWithM
   let firstHidBiasUpdate = add net.FirstHiddenLayer.Bias firstHidBiasNewDeltas
   {
    net with
     FirstHiddenLayer = {
                         net.FirstHiddenLayer with
                          Weights = firstHidInputWeightsUpdate
                          Bias = firstHidBiasUpdate
                          PrevDeltas = firstHidNewDeltas
                          BiasPrevDeltas = firstHidBiasNewDeltas
                     }
     SecondHiddenLayer = {
                          net.SecondHiddenLayer with
                           Weights = secHidInputWeightsUpdate
                           Bias = secHidBiasUpdate
                           PrevDeltas = secHidNewDeltas
                           BiasPrevDeltas = secHidBiasNewDeltas
                     }
     OutputLayer = {
                    net.OutputLayer with
                     Weights = out_hidden_weights_update
                     Bias = out_bias_update
                     PrevDeltas = out_deltas
                     BiasPrevDeltas = out_bias_deltas
                     }
   }
  
  let rec train
  
negative.code:                 Inputs = List.empty
                  Weights = ((*) hiddenSize outputSize) |> listRandElems |> List.chunkBySize hiddenSize
                  Bias = listRandElems outputSize
                  Gradients = List.empty
                  PrevDeltas = List.replicate outputSize <| List.replicate hiddenSize 0.0
                  BiasPrevDeltas = List.replicate outputSize 0.0
                  NetOutputs = List.empty
  