TNeuronInputSqSum.h

Go to the documentation of this file.
00001 // @(#)root/tmva $Id: TNeuronInputSqSum.h 29122 2009-06-22 06:51:30Z brun $
00002 // Author: Matt Jachowski 
00003 
00004 /**********************************************************************************
00005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
00006  * Package: TMVA                                                                  *
00007  * Class  : TMVA::TNeuronInputSqSum                                               *
00008  * Web    : http://tmva.sourceforge.net                                           *
00009  *                                                                                *
00010  * Description:                                                                   *
00011  *       TNeuron input calculator -- calculates the square                        *
00012  *       of the weighted sum of inputs.                                           *
00013  *                                                                                *
00014  * Authors (alphabetical):                                                        *
00015  *      Matt Jachowski  <jachowski@stanford.edu> - Stanford University, USA       *
00016  *                                                                                *
00017  * Copyright (c) 2005:                                                            *
00018  *      CERN, Switzerland                                                         *
00019  *                                                                                *
00020  * Redistribution and use in source and binary forms, with or without             *
00021  * modification, are permitted according to the terms listed in LICENSE           *
00022  * (http://tmva.sourceforge.net/LICENSE)                                          *
00023  **********************************************************************************/
00024  
00025 
00026 #ifndef ROOT_TMVA_TNeuronInputSqSum
00027 #define ROOT_TMVA_TNeuronInputSqSum
00028 
00029 //////////////////////////////////////////////////////////////////////////
00030 //                                                                      //
00031 // TNeuronInputSqSum                                                    //
00032 //                                                                      //
00033 // TNeuron input calculator -- calculates the squared weighted sum of   //
00034 // inputs                                                               //
00035 //                                                                      //
00036 //////////////////////////////////////////////////////////////////////////
00037 
00038 #ifndef ROOT_TObject
00039 #include "TObject.h"
00040 #endif
00041 #ifndef ROOT_TString
00042 #include "TString.h"
00043 #endif
00044 
00045 #ifndef ROOT_TMVA_TNeuronInput
00046 #include "TMVA/TNeuronInput.h"
00047 #endif
00048 #ifndef ROOT_TMVA_TNeuron
00049 #include "TMVA/TNeuron.h"
00050 #endif
00051 
00052 namespace TMVA {
00053   
00054    class TNeuronInputSqSum : public TNeuronInput {
00055     
00056    public:
00057 
00058       TNeuronInputSqSum() {}
00059       virtual ~TNeuronInputSqSum() {}
00060 
00061       // calculate the input value for the neuron
00062       Double_t GetInput( const TNeuron* neuron ) const {
00063          if (neuron->IsInputNeuron()) return 0;
00064          Double_t result = 0;
00065          for (Int_t i=0; i < neuron->NumPreLinks(); i++) {
00066             Double_t val = neuron->PreLinkAt(i)->GetWeightedValue();
00067             result += val*val;
00068          }
00069          return result;
00070       }
00071 
00072       // name of the class
00073       TString GetName() { return "Sum of weighted activations squared"; }
00074 
00075       ClassDef(TNeuronInputSqSum,0) // Calculates square of  weighted sum of neuron inputs
00076    };
00077 
00078 } // namespace TMVA
00079 
00080 #endif

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