Giter VIP home page Giter VIP logo

ml.cpp's Introduction

ML.cpp

Best way to lean how something works is implement it from scratch, so here I wanted to get a closer look to C++11 and some machine learning algorithm.

Features

Many of the following component are quite modular, thus can be easily extended or replaced.

  • Data normalization: MinMax with custom range and z-score normalization; automatic dataset normalization.
  • Neuron activation: Linear, sigmoid and tanh with parameterized slope.
  • Network: Arbitrary acyclic topologies can be built.
  • Learning algorithm: Backpropagation is the only algorithm implemented. It provides: momentum , regularization through weight penalization, variable batch size, variable weights initialization, separated loss function for gradient and performance, pluggable custom stop criterias, pluggable learning observer to perform custom action through the iterations (e.g. to measure selection error).
  • Loss: Mean squared error, mean euclidean error, misclassification ratio.
  • Stop criteria: Maximum iteration threshold, training error threshold (lower and upper), simple early stop.
  • Model selection: Multiprocess grid search with hold-out cross-validation.

Limitations and improvements

  • Persistence hasn’t been handled yet. The lack of strong reflection mechanism in C++ make serialization and deserialization quite a pain in the ass.
  • Neurons representation is explicit, however a more compact representation may have led to further optimization (e.g. vectorization, no virtual methods invoke, no object allocation).
  • Multiprocess grid search have been implemented quite naively with the only purpose to speed up experiments, no IPC mechanism have been implemented. So, for instance, worker results are stored in files and their collection is not handled by the system, is left to post processing
  • Exp performance is the bottleneck of the whole system, some investigation on fastest sigmoid may led to great performance improvements

Examples

  • Monk's problem

Portability

  • Easy to use on all run/build enviroment

License

MIT

ml.cpp's People

Contributors

m-colombo avatar

Stargazers

Juan Fernandez Melero avatar

Watchers

James Cloos avatar  avatar

ml.cpp's Issues

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.