Programming language: F#
Tags: Machine Learning     Projects    
Latest version: v7.1.1
Add another 'Machine Learning' Library



A lightweight Neural Network library, for js, jvm and .net.



The interface of the library is common across programming languages.

Create a Neural Network

NeuralNetwork.init param1: layers returns
JavaScript number[] NeuralNetwork
Java int[] NeuralNetwork
C# int[] NeuralNetwork
Scala List[Int] NeuralNetwork
F# List<int> NeuralNetwork
NeuralNetwork.customizedInit param1: layers param2: activationF param3: weightInitF returns
JavaScript number[] (number) => ActivationFunction (number) => number NeuralNetwork
Java int[] IntFunction<ActivationFunction> IntFunction<Double> NeuralNetwork
C# int[] Func<int, ActivationFunction> Func<int, Double> NeuralNetwork
Scala List[Int] Int => ActivationFunction Int => Double NeuralNetwork
F# List<int> int -> ActivationFunction int -> float NeuralNetwork

Train a Neural Network

NeuralNetwork.fit param1: neuralNetwork param2: learningRate param3: inputValues param4: expectedOutput returns
JavaScript NeuralNetwork number number[] number[] NeuralNetwork
Java NeuralNetwork double double[] double[] NeuralNetwork
C# NeuralNetwork double double[] double[] NeuralNetwork
Scala NeuralNetwork Double List[Double] List[Double] NeuralNetwork
F# NeuralNetwork float List<float> List<float> NeuralNetwork
NeuralNetwork.prediction param1: neuralNetwork param2: inputValues returns
JavaScript NeuralNetwork number[] number[]
Java NeuralNetwork double[] double[]
C# NeuralNetwork double[] double[]
Scala NeuralNetwork List[Double] List[Double]
F# NeuralNetwork List<float> List<float>

Convert a Neural Network

NeuralNetwork.toJson param1: neuralNetwork returns
JavaScript NeuralNetwork string
Java NeuralNetwork String
C# NeuralNetwork string
Scala NeuralNetwork String
F# NeuralNetwork string
NeuralNetwork.ofJson param1: json returns
JavaScript string NeuralNetwork
Java String NeuralNetwork
C# string NeuralNetwork
Scala String NeuralNetwork
F# string NeuralNetwork

Create a Data Preprocessor

DataPreprocessor.init param1: keysWithDiscreteFlags param2: datapoints returns
JavaScript any[][] iterable DataPreprocessor
Java Object[][] Stream<Map<String,String>> DataPreprocessor
C# (string, bool)[] IEnumerable<Dictionary<string, string>> DataPreprocessor
Scala List[(String, Boolean)] LazyList[Map[String, String]] DataPreprocessor
F# List<string * bool> seq<Map<string, string>> DataPreprocessor

Encode with a Data Preprocessor

DataPreprocessor.encodedDatapoint param1: dataPreprocessor param2: datapoint returns
JavaScript DataPreprocessor object number[]
Java DataPreprocessor Map<String,String> double[]
C# DataPreprocessor Dictionary<string, string> double[]
Scala DataPreprocessor Map[String, String] List[Double]
F# DataPreprocessor Map<string, string> List<float>
DataPreprocessor.decodedDatapoint param1: dataPreprocessor param2: encodedDatapoint returns
JavaScript DataPreprocessor number[] object
Java DataPreprocessor double[] Map<String,String>
C# DataPreprocessor double[] Dictionary<string, string>
Scala DataPreprocessor List[Double] Map[String, String]
F# DataPreprocessor List<float> Map<string, string>

Convert a Data Preprocessor

DataPreprocessor.toJson param1: dataPreprocessor returns
JavaScript DataPreprocessor string
Java DataPreprocessor String
C# DataPreprocessor string
Scala DataPreprocessor String
F# DataPreprocessor string
DataPreprocessor.ofJson param1: json returns
JavaScript string DataPreprocessor
Java String DataPreprocessor
C# string DataPreprocessor
Scala String DataPreprocessor
F# string DataPreprocessor

Calculate the Root Mean Square Error

Statistics.rootMeanSquareError param1: expectedWithOutputValues returns
JavaScript iterable number
Java Stream<double[][]> double
C# IEnumerable<(double[], double[])> double
Scala LazyList[(List[Double], List[Double])] Double
F# seq<List<float> * List<float>> float


  • [JavaScript](test-projects%2FJavaScriptTest%2Ftest)
  • [Java](test-projects%2FJavaTest%2Fsrc%2Ftest%2Fjava)
  • [C#](test-projects%2FCSharpTest)
  • [Scala](test-projects%2FScalaTest%2Fsrc%2Ftest%2Fscala)
  • [F#](test-projects%2FF%23Test)


  • [JavaScript](ScalaJS%2Fsrc%2Fmain%2Fscala%2Fsynapses%2FLibrary.scala) - built with Scala.js
  • [Java](Scala%2Fsrc%2Fmain%2Fjava%2Fsynapses%2Fjvm%2Flibrary) - Scala interoperability
  • [C#](CSharp) - F# dependency
  • [Scala](Scala%2Fsrc%2Fmain%2Fscala%2Fsynapses%2Fmodel)
  • [F#](F%23%2FModel)