anchor.diff:      let transpose (M : Matrix<float>) = M.Transpose()
   
       let addHiddenBiases rbm = Matrix.mapCols (fun _ col -> col + rbm.HiddenBiases)
  -
       let addVisibleBiases rbm = Matrix.mapRows (fun _ row -> row + rbm.VisibleBiases)
   
       let forward rbm v = rbm.Weights * (transpose v) |> addHiddenBiases rbm |> transpose
  -
       let backward rbm h = h * rbm.Weights |> addVisibleBiases rbm
   
       let sumOfRows M = M |> Matrix.sumRowsBy (fun _ row -> row)
  -
       let sumOfSquares M = M |> Matrix.fold (fun acc element -> acc + element * element) 0.0
   
       let activate (rnd : AbstractRandomNumberGenerator) activation xInputs =
  
positive.code:         )
  
      let batchesOf n =
          Seq.ofList >>
          Seq.mapi (fun i v -> i / n, v) >>
          Seq.groupBy fst >>
          Seq.map snd >>
          Seq.map (Seq.map snd >> Seq.toList) >>
          Seq.toList
      
      let epoch rnd batchSize rbm xInputs =
          let xRand = permuteRows rnd xInputs
  
negative.code: 
      let permutation (rnd : AbstractRandomNumberGenerator) list =
          list |> List.sortBy (fun element -> rnd.NextDouble())
      let permute rnd n = permutation rnd [0..(n-1)]
      let permuteRows rnd (M : Matrix<float>) = 
          permute rnd M.RowCount |> List.map (fun i -> M.Row i) |> DenseMatrix.ofRowVectors
  
      let updateWeights rnd rbm (batch : Matrix<float>) =
          let batchSize = float batch.RowCount
  