Giter VIP home page Giter VIP logo

xmmjs's Introduction

xmmjs - A Javascript port of the XMM Library

From Ircam's XMM library (https://github.com/Ircam-RnD/xmm):

XMM is a portable, cross-platform C++ library that implements Gaussian Mixture Models and Hidden Markov Models for recognition and regression. The XMM library was developed for movement interaction in creative applications and implements an interactive machine learning workflow with fast training and continuous, real-time inference.

Installing

Node.js

yarn add xmmjs
# OR
npm install --save xmmjs

In the browser

<script src="https://cdn.jsdelivr.net/gh/JulesFrancoise/xmmjs/dist/index.js"></script>

Getting Started

Basic example of GMM-based recognition

const xmm = require('xmmjs');

// Create a training set to host the training data
const ts = xmm.TrainingSet({ inputDimension: 3 });

// Add a new phrase to the training set, and record data frames
const phrase1 = ts.push(0, 'one');
for (let i = 0; i < 1000; i += 1) {
  const frame = Array.from(Array(3), () => Math.random()); // get data from somewhere
  phrase1.push(frame);
}
const phrase2 = ts.push(1, 'two');
for (let i = 0; i < 1000; i += 1) {
  const frame = Array.from(Array(3), () => 1 + Math.random()); // get data from somewhere
  phrase2.push(frame);
}

// Train the GMM with the given configuration
const configuration = {
  gaussians: 3,
  regularization: {
    absolute: 1e-1,
    relative: 1e-10,
  },
  covarianceMode: 'full',
};
const gmmParams = xmm.trainMulticlassGMM(ts, configuration);

// Create a predictor to perform real-time recognition
const predictor = xmm.MulticlassGMMPredictor(gmmParams);
predictor.reset();

predictor.predict([0.5, 0.5, 0.5]);
console.log('results (0.5)', predictor.results);

predictor.predict([1.5, 1.5, 1.5]);
console.log('results (1.5)', predictor.results);

Credits

xmmjs has been developed at LIMSI-CNRS by Jules Françoise, and is released under the MIT Licence.

xmmjs is based on the XMM C++ Library developed at Ircam-Centre Pompidou: https://github.com/Ircam-RnD/xmm

xmmjs's People

Contributors

julesfrancoise avatar

Stargazers

Fran Grgić avatar Victor Saiz avatar James Staub avatar Ben Forest avatar

Watchers

James Cloos avatar  avatar

Forkers

deek121477

xmmjs's Issues

Complement documentation

  • Fix documentation for predictors!
  • Add a basic example of 2D recognition (mouse input)
  • Add an example of mobile gesture recognition (devicemotion)
  • Complement the description of algorithms and parameters

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.