anchor.diff:   =
    let trainOnce = feedForward >> backPropagate
   
  - let networkDistance network = distance network.TargetOutputs network.Outputs
  + let networkDistance network = distance network.TargetOutputs network.OutputLayer.NetOutputs
   
    match epoch with
    | 0 -> netAcc
  
positive.code:  train
    epoch network
    ((Array.toList training_samples), (Array.toList teaching_inputs))
    ((Array.toList testing_samples), (Array.toList teaching_samples_inputs))
  
negative.code: /// Delta or The Rate of Change.
  let deltas learningRate gradients netOutputs = List.map <| smul learningRate <| mapToSecondList (*) gradients netOutputs
  
  /// Represents a Network Layer.
  type Layer = {
    Inputs: List<float>
    Weights: List<List<float>>
    Bias: List<float>
    PrevDeltas: List<List<float>>
    BiasPrevDeltas: List<float>
    NetOutputs: List<float>
    }
  
  /// Represents a Feed Forward Network.
  type Network = {
   LearningRate: float
   Momentum: float
   Inputs: List<float>
   HiddenLayer : Layer
   OutputLayer : Layer
   TargetOutputs: List<float>
   }
  
  let feedForward net =
   let hiddenWeightedSum = weightedSum net.Inputs net.HiddenLayer.Weights net.HiddenLayer.Bias
   let hiddenNetOutputs = List.map tanh hiddenWeightedSum
   let outputWeightedSum = weightedSum hiddenNetOutputs net.OutputLayer.Weights net.OutputLayer.Bias
   let outputs = List.map tanh outputWeightedSum
   {
    net with
     HiddenLayer = { net.HiddenLayer with NetOutputs = hiddenNetOutputs }
     OutputLayer = { net.OutputLayer with NetOutputs = outputs }
   }
  
  let backPropagate (net:Network) =
  
   let out_grads = List.map2 (gradient deltaTanH) net.OutputLayer.NetOutputs net.TargetOutputs
   let out_deltas = deltas net.LearningRate out_grads net.HiddenLayer.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 hid_grads = mul (List.map deltaTanH net.HiddenLayer.NetOutputs) (List.map (dot out_grads) (transpose net.OutputLayer.Weights))
   let hid_deltas = deltas net.LearningRate hid_grads net.Inputs
   let hid_prevDeltasWithM = List.map (smul net.Momentum) net.HiddenLayer.PrevDeltas
   let hid_newDeltas = List.map2 add hid_deltas hid_prevDeltasWithM
   let hid_input_weights_update = List.map2 add net.HiddenLayer.Weights hid_newDeltas
   let hid_bias_deltas = smul net.LearningRate hid_grads
   let hid_bias_prevDeltasWithM = smul net.Momentum net.HiddenLayer.BiasPrevDeltas
   let hid_bias_newDeltas = add hid_bias_deltas hid_bias_prevDeltasWithM
   let hid_bias_update = add net.HiddenLayer.Bias hid_bias_newDeltas
  
   {
    net with
     HiddenLayer = {
                    net.HiddenLayer with
                     Weights = hid_input_weights_update
                     Bias = hid_bias_update
                     PrevDeltas = hid_deltas
                     BiasPrevDeltas = hid_bias_deltas
                     }
     OutputLayer = {
                    net.OutputLayer with
                     Weights = out_hidden_weights_update
                     Bias = out_bias_update
                     PrevDeltas = out_deltas
                     BiasPrevDeltas = out_bias_deltas
                     }
   }
  
  let rec train
  