All Projects → yujiosaka → Js Mind

yujiosaka / Js Mind

Licence: mit
Deep Learning Library Written in ES2015.

Programming Languages

javascript
184084 projects - #8 most used programming language

js-mind

Deep Learning Library Written in ES2015.

API Documentation

Features

  • Activation functions
    • Sigmoid function
    • Softmax function
    • ReLU function
  • Cost Function
    • Cross Entropy Cost Function
  • Regularization
    • L2 Regularization
    • Dropout

How To Use

var Promise = require('bluebird');

var _ = require('lodash');

var jsmind = require('../dist');

var net = new jsmind.Network([
  new jsmind.layers.ReLULayer(784, 100, {pDropout: 0.5}),
  new jsmind.layers.ReLULayer(100, 100, {pDropout: 0.5}),
  new jsmind.layers.SoftmaxLayer(100, 10, {pDropout: 0.5})
]);

Promise.all([
  jsmind.MnistLoader.loadTrainingDataWrapper(),
  jsmind.MnistLoader.loadValidationDataWrapper()
]).spread(function(trainingData, validationData) {
  net.SGD(
    trainingData,
    60, // epochs
    10, // miniBatchSize
    0.03 // eta
  , {
    validationData: validationData,
    lmbda: 0.1
  });
}).then(function() {
  return jsmind.MnistLoader.loadTestDataWrapper();
}).then(function(testData) {
  var testInput, prediction, accuracy;
  testInput = _.unzip(testData)[0];
  accuracy = net.accuracy(testData);
  prediction = net.predict(testInput);
  console.log('Test accuracy ' + accuracy);
  console.log('Test prediction ' + prediction.toString());
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].