// @(#)root/mlp:$Id$
// Author: Christophe.Delaere@cern.ch   25/04/04

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

#ifndef ROOT_TMLPAnalyzer
#define ROOT_TMLPAnalyzer


#ifndef ROOT_TObject
#include "TObject.h"
#endif

class TTree;
class TNeuron;
class TSynapse;
class TMultiLayerPerceptron;
class TProfile;
class THStack;

//____________________________________________________________________
//
// TMLPAnalyzer
//
// This utility class contains a set of tests usefull when developing
// a neural network.
// It allows you to check for unneeded variables, and to control
// the network structure.
//
//--------------------------------------------------------------------

class TMLPAnalyzer : public TObject {

private:
   TMultiLayerPerceptron *fNetwork;
   TTree                 *fAnalysisTree;
   TTree                 *fIOTree;

protected:
   Int_t GetLayers();
   Int_t GetNeurons(Int_t layer);
   TString GetNeuronFormula(Int_t idx);
   const char* GetInputNeuronTitle(Int_t in);
   const char* GetOutputNeuronTitle(Int_t out);

public:
   TMLPAnalyzer(TMultiLayerPerceptron& net): 
      fNetwork(&net), fAnalysisTree(0), fIOTree(0) {}
   TMLPAnalyzer(TMultiLayerPerceptron* net):
      fNetwork(net), fAnalysisTree(0), fIOTree(0) {}
   virtual ~TMLPAnalyzer();
   void DrawNetwork(Int_t neuron, const char* signal, const char* bg);
   void DrawDInput(Int_t i);
   void DrawDInputs();
   TProfile* DrawTruthDeviation(Int_t outnode=0, Option_t *option="");
   THStack* DrawTruthDeviations(Option_t *option="");
   TProfile* DrawTruthDeviationInOut(Int_t innode, Int_t outnode=0,
                                     Option_t *option="");
   THStack* DrawTruthDeviationInsOut(Int_t outnode=0, Option_t *option="");

   void CheckNetwork();
   void GatherInformations();
   TTree* GetIOTree() const { return fIOTree;}

   ClassDef(TMLPAnalyzer, 0) // A simple analysis class for MLP
};

#endif
 TMLPAnalyzer.h:1
 TMLPAnalyzer.h:2
 TMLPAnalyzer.h:3
 TMLPAnalyzer.h:4
 TMLPAnalyzer.h:5
 TMLPAnalyzer.h:6
 TMLPAnalyzer.h:7
 TMLPAnalyzer.h:8
 TMLPAnalyzer.h:9
 TMLPAnalyzer.h:10
 TMLPAnalyzer.h:11
 TMLPAnalyzer.h:12
 TMLPAnalyzer.h:13
 TMLPAnalyzer.h:14
 TMLPAnalyzer.h:15
 TMLPAnalyzer.h:16
 TMLPAnalyzer.h:17
 TMLPAnalyzer.h:18
 TMLPAnalyzer.h:19
 TMLPAnalyzer.h:20
 TMLPAnalyzer.h:21
 TMLPAnalyzer.h:22
 TMLPAnalyzer.h:23
 TMLPAnalyzer.h:24
 TMLPAnalyzer.h:25
 TMLPAnalyzer.h:26
 TMLPAnalyzer.h:27
 TMLPAnalyzer.h:28
 TMLPAnalyzer.h:29
 TMLPAnalyzer.h:30
 TMLPAnalyzer.h:31
 TMLPAnalyzer.h:32
 TMLPAnalyzer.h:33
 TMLPAnalyzer.h:34
 TMLPAnalyzer.h:35
 TMLPAnalyzer.h:36
 TMLPAnalyzer.h:37
 TMLPAnalyzer.h:38
 TMLPAnalyzer.h:39
 TMLPAnalyzer.h:40
 TMLPAnalyzer.h:41
 TMLPAnalyzer.h:42
 TMLPAnalyzer.h:43
 TMLPAnalyzer.h:44
 TMLPAnalyzer.h:45
 TMLPAnalyzer.h:46
 TMLPAnalyzer.h:47
 TMLPAnalyzer.h:48
 TMLPAnalyzer.h:49
 TMLPAnalyzer.h:50
 TMLPAnalyzer.h:51
 TMLPAnalyzer.h:52
 TMLPAnalyzer.h:53
 TMLPAnalyzer.h:54
 TMLPAnalyzer.h:55
 TMLPAnalyzer.h:56
 TMLPAnalyzer.h:57
 TMLPAnalyzer.h:58
 TMLPAnalyzer.h:59
 TMLPAnalyzer.h:60
 TMLPAnalyzer.h:61
 TMLPAnalyzer.h:62
 TMLPAnalyzer.h:63
 TMLPAnalyzer.h:64
 TMLPAnalyzer.h:65
 TMLPAnalyzer.h:66
 TMLPAnalyzer.h:67
 TMLPAnalyzer.h:68
 TMLPAnalyzer.h:69
 TMLPAnalyzer.h:70
 TMLPAnalyzer.h:71
 TMLPAnalyzer.h:72
 TMLPAnalyzer.h:73
 TMLPAnalyzer.h:74