返回排行榜

mlpack/mlpack

C++mlpack.org

mlpack: a fast, header-only C++ machine learning library

machine-learning-libraryc-plus-plusdeep-learningnearest-neighbor-searchregressionmachine-learninghacktoberfestscientific-computing
Star 增长趋势
Star
5.7k
Forks
1.7k
周增长
Issues
7
2k4k
2014年12月2018年10月2022年9月2026年7月
README

mlpack: a fast, header-only machine learning library
a fast, header-only machine learning library

Home | Download | Documentation | Help

GitHub Actions CI License NumFOCUS

Download: current stable version (4.8.0)

mlpack is an intuitive, fast, and flexible header-only C++ machine learning library with bindings to other languages. It is meant to be a machine learning analog to LAPACK, and aims to implement a wide array of machine learning methods and functions as a "swiss army knife" for machine learning researchers.

mlpack's lightweight C++ implementation makes it ideal for deployment and production environments; but it can also be used for interactive prototyping via C++ notebooks.

In addition to its powerful C++ interface, mlpack also provides command-line programs, Python bindings, Julia bindings, Go bindings and R bindings.

Quick links:

mlpack uses an open governance model and is fiscally sponsored by NumFOCUS. Consider making a tax-deductible donation to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.


0. Contents

  1. Citation details
  2. Dependencies
  3. Installation
  4. Usage from C++
    1. Reducing compile time
  5. Building mlpack's test suite
  6. Further resources

1. Citation details

If you use mlpack in your research or software, please cite mlpack using the citation below (given in BibTeX format):

@article{mlpack2023,
    title     = {mlpack 4: a fast, header-only C++ machine learning library},
    author    = {Ryan R. Curtin and Marcus Edel and Omar Shrit and 
                 Shubham Agrawal and Suryoday Basak and James J. Balamuta and 
                 Ryan Birmingham and Kartik Dutt and Dirk Eddelbuettel and 
                 Rishabh Garg and Shikhar Jaiswal and Aakash Kaushik and 
                 Sangyeon Kim and Anjishnu Mukherjee and Nanubala Gnana Sai and 
                 Nippun Sharma and Yashwant Singh Parihar and Roshan Swain and 
                 Conrad Sanderson},
    journal   = {Journal of Open Source Software},
    volume    = {8},
    number    = {82},
    pages     = {5026},
    year      = {2023},
    doi       = {10.21105/joss.05026},
    url       = {https://doi.org/10.21105/joss.05026}
}

Citations are beneficial for the growth and improvement of mlpack.

2. Dependencies

mlpack requires the following additional dependencies:

mlpack bundles the STB, httplib, and dr_libs header-only libraries to provide image loading support, dataset download, and audio loading support, respectively. If you prefer to use versions available on your system, see the compilation options

If you are compiling Armadillo by hand, ensure that LAPACK and BLAS are enabled.

3. Installation

Detailed installation instructions can be found on the Installing mlpack page.

4. Usage from C++

Once headers are installed with make install, using mlpack in an application consists only of including it. So, your program should include mlpack:

#include <mlpack.hpp>

and when you link, be sure to link against Armadillo. If your example program is my_program.cpp, your compiler is GCC, and you would like to compile with OpenMP support (recommended) and optimizations, compile like this:

g++ -O3 -std=c++17 -o my_program my_program.cpp -larmadillo -fopenmp

Note that if you want to serialize (save or load) neural networks, you should add #define MLPACK_ENABLE_ANN_SERIALIZATION before including <mlpack.hpp>. If you don't define MLPACK_ENABLE_ANN_SERIALIZATION and your code serializes a neural network, a compilation error will occur.

MLPACK_ENABLE_ANN_SERIALIZATION allows you to serialize networks using arma::mat as their matrix type. You can also define MLPACK_ENABLE_ANN_SERIALIZATION_FMAT to serialize networks using arma::fmat.

Warning: older versions of OpenBLAS (0.3.26 and older) compiled to use pthreads may use too many threads for computation, causing significant slowdown. OpenBLAS versions compiled with OpenMP do not suffer from this issue. See the test build guide for more details and simple workarounds.

See also:

4.1. Reducing compile time

mlpack is a template-heavy library, and if care is not used, compilation time of a project can be very high. Fortunately, there are a number of ways to reduce compilation time:

  • Include individual headers, like <mlpack/methods/decision_tree.hpp>, if you are only using one component, instead of <mlpack.hpp>. This reduces the amount of work the compiler has to do.

  • Only use the MLPACK_ENABLE_ANN_SERIALIZATION definition if you are serializing neural networks in your code. When this define is enabled, compilation time will increase significantly, as the compiler must generate code for every possible type of layer. (The large amount of extra compilation overhead is why this is not enabled by default.)

  • If you are using mlpack in multiple .cpp files, consider using extern templates so that the compiler only instantiates each template once; add an explicit template instantiation for each mlpack template type you want to use in a .cpp file, and then use extern definitions elsewhere to let the compiler know it exists in a different file.

Other strategies exist too, such as precompiled headers, compiler options, ccache, and others.

5. Building mlpack's test suite

See the installation instruction section.

6. Further Resources

More documentation is available for both users and developers.

To learn about the development goals of mlpack in the short- and medium-term future, see the vision document.

If you have problems, find a bug, or need help, you can try visiting the mlpack help page, or mlpack on Github. Alternately, mlpack help can be found on Matrix at #mlpack; see also the community page.

相关仓库
RasaHQ/rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants

PythonPyPIApache License 2.0nlpmachine-learning
rasa.com/docs/rasa/
21.3k4.9k
davisking/dlib

A toolkit for making real world machine learning and data analysis applications in C++

C++Boost Software License 1.0machine-learningdeep-learning
dlib.net
14.4k3.4k
snipsco/snips-nlu

Snips Python library to extract meaning from text

PythonPyPIApache License 2.0nlpnlu
snips-nlu.readthedocs.io
4k504
nidhaloff/igel

a delightful machine learning tool that allows you to train, test, and use models without writing code

PythonPyPIMIT Licensemachine-learningmachinelearning
igel.readthedocs.io/en/latest/
3.1k208
dreamquark-ai/tabnet

PyTorch implementation of TabNet paper : https://arxiv.org/pdf/1908.07442.pdf

PythonPyPIMIT Licensepytorchdeep-neural-networks
dreamquark-ai.github.io/tabnet/
3k516
explosion/thinc

🔮 A refreshing functional take on deep learning, compatible with your favorite libraries

PythonPyPIMIT Licensemachine-learningdeep-learning
thinc.ai
2.9k294
modAL-python/modAL

A modular active learning framework for Python

PythonPyPIMIT Licensescikit-learnmachine-learning
modal-python.github.io
2.4k324
RasaHQ/rasa_core

Rasa Core is now part of the Rasa repo: An open source machine learning framework to automate text-and voice-based conversations

PythonPyPIApache License 2.0nlpmachine-learning
github.com/RasaHQ/rasa
2.3k990
vaaaaanquish/Awesome-Rust-MachineLearning

This repository is a list of machine learning libraries written in Rust. It's a compilation of GitHub repositories, blogs, books, movies, discussions, papers, etc. 🦀

JavaScriptnpmMIT Licenserustmachine-learning
vaaaaanquish.github.io/Awesome-Rust-MachineLearning/
2.3k126
tensorflow/quantum

An open-source Python framework for hybrid quantum-classical machine learning.

PythonPyPIApache License 2.0cirqgoogle
tensorflow.org/quantum
2.2k658
plasticityai/magnitude

A fast, efficient universal vector embedding utility package.

PythonPyPIMIT Licensepythonnatural-language-processing
1.7k123
ClimbsRocks/auto_ml

[UNMAINTAINED] Automated machine learning for analytics & production

PythonPyPIMIT Licensemachine-learningdata-science
auto-ml.readthedocs.io
1.7k309