Stitch ML
This package is still in Alpha. All future versions are subject to
breaking changes until the official first version, at which point the full
documentation will be released and Semantic Versioning will be used.
Stitch ML is an experimental machine learning library written in pure
Javascript.
Overview
Installation
npm install stitch-ml --save
Usage
With CommonJS:
const StitchML = require('stitch-ml');
With ES Modules:
import StitchML from 'stitch-ml';
Input Data Format
0 <= x <= 1
[
{
"input": [x, x, x, x, x, x, ...],
"output": [x, x, x, x, ...]
},
...
]
Examples
const network = new StitchML.Network({
structure: [784, 100, 10],
});
network.train({ data: trainingData });
network.predict(input);
const modelToSave = network.save();
fs.writeFileSync('model.json', JSON.stringify(modelToSave));
const modelToLoad = JSON.parse(fs.readFileSync('model.json'));
const networkFromModel = new Stitch.Network(modelToLoad);
Performance
MNIST
Dataset: MNIST Handwritten Digits
Device: 2014 Macbook Pro, 2.5 GHz Quad-Core Intel Core i7
Training Set Size: 60000, One Epoch
Test Set Size: 10000
---------------------------------------------------------
Training Time: 2:57.259 (m:ss.mmm)
Prediction Time: 0.789 ms
Accuracy: 9441 / 10000