anchor.diff:      let newNet, _, _, _ = 
           let outCount = netOutputs.Length
           let netWeights = [for x in [1..outCount] -> [for y in [1..outCount] -> if x = y then 1.0 else 0.0]]
  -        let netDeltas = List.map2 (fun answer output -> answer - output) answers netOutputs 
  -        let initialState = ([], netOutputs, netWeights, netDeltas)
  +        let netErrors = List.map2 (fun answer output -> answer - output) answers netOutputs 
  +        let initialState = ([], netOutputs, netWeights, netErrors)
           (allInputs, net, initialState) |||> List.foldBack2 getBpData 
       newNet
   
  
positive.code: ﻿open System
  open System.IO
  open persistence
  
  let bias = 1.0
  let learningConstant = 0.9
  
  // Creating
  let rnd = System.Random()
  let randomWeight() =  rnd.NextDouble() * 2.0 - 1.0
  
  let createNeuron inputCount =
      [for i in 1 .. inputCount -> randomWeight()]
  
  let createLayer neuronCount inputCount =
      [for i in 1 .. neuronCount -> createNeuron (inputCount + 1)]
      
  let createNet netInputCount hiddenLayerSizes outputLayerSize = 
      let neuronLayerSizes = hiddenLayerSizes @ [outputLayerSize]
      let inputCounts = netInputCount :: hiddenLayerSizes
      (neuronLayerSizes, inputCounts) ||> List.map2 createLayer
  
  // Evaluating
  let sigmoid x = 1.0 / (1.0 + exp -x)
  
  let evalNeuron inputs neuron =
      let aggregate sum a b = sum + a * b
      let sum = ((0.0, neuron, inputs) |||> List.fold2 aggregate)
      let result = sigmoid sum
      result
  
  let evalLayer inputs layer =
      (layer |> List.map (evalNeuron (bias::inputs)))
  
  let evalNet net netInputs =
      net |> List.scan evalLayer netInputs
  
  let evalOutputs net netInputs =
      evalNet net netInputs |> List.reduce (fun _ l -> l)
  
  // Training
  let bodyAndTail list =
  
negative.code: 
  // Train XOr
  let goXor() = 
      let net = createNet [2; 2; 1]
      let samples = getSamples xorCases 100000
      printfn "cost before: %f" (calcCost samples (feedForward net) )
      xorCases |> Array.iter (fun (inputs, answer) -> printfn "%f" (feedForward net inputs).[0])
      let finalNet = (net, samples) ||> List.fold (fun net (input, answers) -> (trainNet net input answers))
      printfn "cost after:  %f" (calcCost samples (feedForward finalNet) )
      xorCases |> Array.iter (fun (inputs, answer) -> printfn "%f" (feedForward finalNet inputs).[0])
  
  let maxIndex list =
      list
  