Numerical learning library

链接:https://code.google.com/p/nll/

NLL is a multi-platform open source project entirely written in C++. Its goal is to propose generic and efficient algorithms for machine learning and more specifically computer vision. It is intended to be very easy to integrate and it is mainly composed of header files with no dependency on any library but the STL.

Architecture

NLL implements generic algorithms using template metaprogramming and a minimalist interface. Several layers are used:

  • core: the very basic structures and operations
  • algorithm_impl: generic algorithms with very limited dependencies and interface
  • algorithm: algorithms taking advantage of the NLL framework
  • imaging: algorithms related to imaging techniques such as volumes, slices, blending, lut tables, multi-planar reconstruction or maximum intensity projection.

Details

Here is an overview of some algorithms implemented in NLL:

  • classifiers (k-nearest neighbour, multi-layered neural networks, support vector machines, boosting, gaussian mixture model, quadratic discriminant, radial basis function, naive bayes)
  • feature selection (best-first, wrapper using genetic algorithm, relief-f, pearson)
  • feature transformation (PCA, kernel PCA, ICA)
  • optimizers (grid search, harmony search, genetic algorithms, powell)
  • math library (matrix, vector, linear algebra, distributions)
  • image library (resampling, morphology, transformations, convolutions, region growing, labeling, SURF)
  • visualization of high-dimensional data (locally linear embedding, Sammon's mapping)
  • volume library (resampling, maximum intensity projection, multi-planar reconstruction)
  • clustering (k-means, LSDBC)
  • kd-trees, gabor filters, haar features
  • markov chain, hidden markov model
  • RANSAC estimator
  • ... and much more soon!

Example

Here is a typical use of the framework:

/**
 In this test a neural network will be optimized using a harmony search algorithm.
 */
void test()
{
   typedef nll::benchmark::BenchmarkDatabases::Database::Sample::Input  Input;
   typedef nll::algorithm::Classifier<Input>                            Classifier;

   // find the cancer1.dt benchmark
   const nll::benchmark::BenchmarkDatabases::Benchmark* benchmark = nll::benchmark::BenchmarkDatabases::instance().find( "cancer1.dt" );
   ensure( benchmark, "can't find benchmark" );
   Classifier::Database dat = benchmark->database;

   // use a multi layered perceptron as a classifier
   typedef algorithm::ClassifierMlp<Input> ClassifierImpl;
   ClassifierImpl classifier;

   // optimize the parameters of the classifier on the original dataset
   // we will use a harmony search algorithm.
   // For each point, the classifier is evaluated: a 10-fold cross validation is
   // run on the learning database
   Classifier::OptimizerClientClassifier classifierOptimizer = classifier.createOptimizer( dat );

   // configure the optimizer options
   nll::algorithm::StopConditionIteration stop( 10 );
   nll::algorithm::MetricEuclidian<nll::algorithm::OptimizerHarmonySearchMemory::TMetric::value_type> metric;
   nll::algorithm::OptimizerHarmonySearchMemory parametersOptimizer( 5, 0.8, 0.1, 1, &stop, 0.01, &metric );

   // run the optimizer on the default constrained classifier parameters
   // if the default values don't fit, other constraint parameters should be given
   std::vector<double> params = parametersOptimizer.optimize( classifierOptimizer, ClassifierImpl::buildParameters() );
   
   // learn the LEARNING and VALIDATION database with the optimized parameters, and test the classifier
   // on the TESTING database
   classifier.learnTrainingDatabase( dat, nll::core::make_buffer1D( params ) );
   Classifier::Result rr = classifier.test( dat );

   TESTER_ASSERT( rr.testingError < 0.025 );
}

Tutorials

Here for a list of tutorials and samples of code: Tutorials

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值