ROOT logo
// @(#)root/tmva $Id: TNeuronInputSqSum.h 29122 2009-06-22 06:51:30Z brun $
// Author: Matt Jachowski 

/**********************************************************************************
 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
 * Package: TMVA                                                                  *
 * Class  : TMVA::TNeuronInputSqSum                                               *
 * Web    : http://tmva.sourceforge.net                                           *
 *                                                                                *
 * Description:                                                                   *
 *       TNeuron input calculator -- calculates the square                        *
 *       of the weighted sum of inputs.                                           *
 *                                                                                *
 * Authors (alphabetical):                                                        *
 *      Matt Jachowski  <jachowski@stanford.edu> - Stanford University, USA       *
 *                                                                                *
 * Copyright (c) 2005:                                                            *
 *      CERN, Switzerland                                                         *
 *                                                                                *
 * Redistribution and use in source and binary forms, with or without             *
 * modification, are permitted according to the terms listed in LICENSE           *
 * (http://tmva.sourceforge.net/LICENSE)                                          *
 **********************************************************************************/
 

#ifndef ROOT_TMVA_TNeuronInputSqSum
#define ROOT_TMVA_TNeuronInputSqSum

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TNeuronInputSqSum                                                    //
//                                                                      //
// TNeuron input calculator -- calculates the squared weighted sum of   //
// inputs                                                               //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

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

#ifndef ROOT_TMVA_TNeuronInput
#include "TMVA/TNeuronInput.h"
#endif
#ifndef ROOT_TMVA_TNeuron
#include "TMVA/TNeuron.h"
#endif

namespace TMVA {
  
   class TNeuronInputSqSum : public TNeuronInput {
    
   public:

      TNeuronInputSqSum() {}
      virtual ~TNeuronInputSqSum() {}

      // calculate the input value for the neuron
      Double_t GetInput( const TNeuron* neuron ) const {
         if (neuron->IsInputNeuron()) return 0;
         Double_t result = 0;
         for (Int_t i=0; i < neuron->NumPreLinks(); i++) {
            Double_t val = neuron->PreLinkAt(i)->GetWeightedValue();
            result += val*val;
         }
         return result;
      }

      // name of the class
      TString GetName() { return "Sum of weighted activations squared"; }

      ClassDef(TNeuronInputSqSum,0) // Calculates square of  weighted sum of neuron inputs
   };

} // namespace TMVA

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