TMLPAnalyzer.h

Go to the documentation of this file.
00001 // @(#)root/mlp:$Id: TMLPAnalyzer.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Christophe.Delaere@cern.ch   25/04/04
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2003, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TMLPAnalyzer
00013 #define ROOT_TMLPAnalyzer
00014 
00015 
00016 #ifndef ROOT_TObject
00017 #include "TObject.h"
00018 #endif
00019 
00020 class TTree;
00021 class TNeuron;
00022 class TSynapse;
00023 class TMultiLayerPerceptron;
00024 class TProfile;
00025 class THStack;
00026 
00027 //____________________________________________________________________
00028 //
00029 // TMLPAnalyzer
00030 //
00031 // This utility class contains a set of tests usefull when developing
00032 // a neural network.
00033 // It allows you to check for unneeded variables, and to control
00034 // the network structure.
00035 //
00036 //--------------------------------------------------------------------
00037 
00038 class TMLPAnalyzer : public TObject {
00039 
00040 private:
00041    TMultiLayerPerceptron *fNetwork;
00042    TTree                 *fAnalysisTree;
00043    TTree                 *fIOTree;
00044 
00045 protected:
00046    Int_t GetLayers();
00047    Int_t GetNeurons(Int_t layer);
00048    TString GetNeuronFormula(Int_t idx);
00049    const char* GetInputNeuronTitle(Int_t in);
00050    const char* GetOutputNeuronTitle(Int_t out);
00051 
00052 public:
00053    TMLPAnalyzer(TMultiLayerPerceptron& net): 
00054       fNetwork(&net), fAnalysisTree(0), fIOTree(0) {}
00055    TMLPAnalyzer(TMultiLayerPerceptron* net):
00056       fNetwork(net), fAnalysisTree(0), fIOTree(0) {}
00057    virtual ~TMLPAnalyzer();
00058    void DrawNetwork(Int_t neuron, const char* signal, const char* bg);
00059    void DrawDInput(Int_t i);
00060    void DrawDInputs();
00061    TProfile* DrawTruthDeviation(Int_t outnode=0, Option_t *option="");
00062    THStack* DrawTruthDeviations(Option_t *option="");
00063    TProfile* DrawTruthDeviationInOut(Int_t innode, Int_t outnode=0,
00064                                      Option_t *option="");
00065    THStack* DrawTruthDeviationInsOut(Int_t outnode=0, Option_t *option="");
00066 
00067    void CheckNetwork();
00068    void GatherInformations();
00069    TTree* GetIOTree() const { return fIOTree;}
00070 
00071    ClassDef(TMLPAnalyzer, 0) // A simple analysis class for MLP
00072 };
00073 
00074 #endif

Generated on Tue Jul 5 14:27:18 2011 for ROOT_528-00b_version by  doxygen 1.5.1