<commit_before>// @(#)root/mlp:$Name:  $:$Id: TMultiLayerPerceptron.cxx,v 1.36 2006/05/11 09:42:41 brun Exp $
// Author: <EMAIL>   20/07/03

/*************************************************************************
 * Copyright (C) 1995-2003, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

///////////////////////////////////////////////////////////////////////////
//
// TMultiLayerPerceptron
//
// This class describes a neural network.
// There are facilities to train the network and use the output.
//
// The input layer is made of inactive neurons (returning the
// optionaly normalized input) and output neurons are linear.
// The type of hidden neurons is free, the default being sigmoids.
// (One should still try to pass normalized inputs, e.g. between [0.,1])
//
// The basic input is a TTree and two (training and test) TEventLists.
// Input and output neurons are assigned a value computed for each event
// with the same possibilities as for TTree::Draw().
// Events may be weighted individualy or via TTree::SetWeight().
// 6 learning methods are available: kStochastic, kBatch,
// kSteepestDescent, kRibierePolak, kFletcherReeves and kBFGS.
//
// This implementation, written by <NAME>, is *inspired* from
// the mlpfit package from J.Schwindling et al.
//
///////////////////////////////////////////////////////////////////////////
//BEGIN_HTML <!--
/* -->
<UL>
        <LI><P><A NAME="intro"></A><FONT COLOR="#5c8526">
        <FONT SIZE=4 STYLE="font-size: 15pt">Introduction</FONT></FONT></P>
</UL>
<P>Neural Networks are more and more used in various fields for data
analysis and classification, both for research and commercial
institutions. Some randomly choosen examples are:</P>
<UL>
        <LI><P>image analysis</P>
        <LI><P>financial movements predictions and analysis</P>
        <LI><P>sales forecast and product shipping optimisation</P>
        <LI><P>in particles physics: mainly for classification tasks (signal
        over background discrimination)</P>
</UL>
<P>More than 50% of neural networks are multilayer perceptrons. This
implementation of multilayer perceptrons is inspired from the
<A HREF="http://schwind.home.cern.ch/schwind/MLPfit.html">MLPfit
package</A> originaly written by <NAME>. MLPfit remains
one of the fastest tool for neural networks studies, and this ROOT
add-on will not try to compete on that. A clear and flexible Object
Oriented implementation has been choosen over a faster but more
difficult to maintain code. Nevertheless, the time penalty does not
exceed a factor 2.</P>
<UL>
        <LI><P><A NAME="mlp"></A><FONT COLOR="#5c8526"><commit_msg>From <NAME> Add a few more comments explaining the difference/enhancements between the original MLPFIT package and TMultiLayerPerceptron.<commit_after>// @(#)root/mlp:$Name:  $:$Id: TMultiLayerPerceptron.cxx,v 1.37 2006/05/26 15:13:02 rdm Exp $
// Author: <EMAIL>   20/07/03

/*************************************************************************
 * Copyright (C) 1995-2003, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

///////////////////////////////////////////////////////////////////////////
//
// TMultiLayerPerceptron
//
// This class describes a neural network.
// There are facilities to train the network and use the output.
//
// The input layer is made of inactive neurons (returning the
// optionaly normalized input) and output neurons are linear.
// The type of hidden neurons is free, the default being sigmoids.
// (One should still try to pass normalized inputs, e.g. between [0.,1])
//
// The basic input is a TTree and two (training and test) TEventLists.
// Input and output neurons are assigned a value computed for each event
// with the same possibilities as for TTree::Draw().
// Events may be weighted individualy or via TTree::SetWeight().
// 6 learning methods are available: kStochastic, kBatch,
// kSteepestDescent, kRibierePolak, kFletcherReeves and kBFGS.
//
// This implementation, written by <NAME>, is *inspired* from
// the mlpfit package from J.Schwindling et al. with some extensions:
//   * the algorithms are globally the same
//   * in TMultilayerPerceptron, there is no limitation on the number of 
//     layers/neurons, while MLPFIT was limited to 2 hidden layers
//   * TMultilayerPerceptron allows you to save the network in a root file, and 
//     provides more export functionnalities
//   * TMultilayerPerceptron gives more flexibility regarding the normalization of 
//     inputs/outputs
//   * TMultilayerPerceptron provides, thanks to <NAME>, the possibility to 
//     use cross-entropy errors, which allows to train a network for pattern 
//     classification based on Bayesian posterior probability.
//
///////////////////////////////////////////////////////////////////////////
//BEGIN_HTML <!--
/* -->
<UL>
        <LI><P><A NAME="intro"></A><FONT COLOR="#5c8526">
        <FONT SIZE=4 STYLE="font-size: 15pt">Introduction</FONT></FONT></P>
</UL>
<P>Neural Networks are more and more used in various fields for data
analysis and classification, both for research and commercial
institutions. Some randomly choosen examples are:</P>
<UL>
        <LI><P>image analysis</P>
        <LI><P>financial movements predictions and analysis</P>
        <LI><P>sales forecast and product shipping optimisation</P>
        <LI><P>in particles physics: mainly for classification tasks (signal
        over background discrimination)</P>
</UL>
<P>More than 50% of neural networks are multilayer perceptrons. This
implementation of multilayer perceptrons is inspired from the
<A HREF="http://schwind.home.cern.ch/schwind/MLPfit.html">MLPfit
package</A> originaly written by <NAME>. MLPfit remains
one of the fastest tool for neural networks studies, and this ROOT
add-on will not try to compete on that. A clear and flexible Object
Oriented implementation has been choosen over a faster but more
difficult to maintain code. Nevertheless, the time penalty does not
exceed a factor 2.</P>
<UL>
        <LI><P><A NAME="mlp"></A><FONT COLOR="#5c8526">
{'fraction_non_alphanumeric': 0.18119810201660735, 'fraction_numerical': 0.014976275207591934, 'mean_word_length': 2.620504562533548, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1764665', 'n_tokens_mistral': 1851, 'n_tokens_neox': 1684, 'n_words': 693}