ROOT   Reference Guide
TNeuronInputSqSum.h
Go to the documentation of this file.
1// @(#)root/tmva $Id$
2// Author: Matt Jachowski
3
4/**********************************************************************************
5 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6 * Package: TMVA *
7 * Class : TMVA::TNeuronInputSqSum *
8 * Web : http://tmva.sourceforge.net *
9 * *
10 * Description: *
11 * TNeuron input calculator -- calculates the square *
12 * of the weighted sum of inputs. *
13 * *
14 * Authors (alphabetical): *
15 * Matt Jachowski <jachowski@stanford.edu> - Stanford University, USA *
16 * *
17 * Copyright (c) 2005: *
18 * CERN, Switzerland *
19 * *
20 * Redistribution and use in source and binary forms, with or without *
21 * modification, are permitted according to the terms listed in LICENSE *
23 **********************************************************************************/
24
25
26#ifndef ROOT_TMVA_TNeuronInputSqSum
27#define ROOT_TMVA_TNeuronInputSqSum
28
29//////////////////////////////////////////////////////////////////////////
30// //
31// TNeuronInputSqSum //
32// //
33// TNeuron input calculator -- calculates the squared weighted sum of //
34// inputs //
35// //
36//////////////////////////////////////////////////////////////////////////
37
38#include "TMVA/TNeuronInput.h"
39#include "TMVA/TNeuron.h"
40
41namespace TMVA {
42
44
45 public:
46
48 virtual ~TNeuronInputSqSum() {}
49
50 // calculate the input value for the neuron
51 Double_t GetInput( const TNeuron* neuron ) const {
52 if (neuron->IsInputNeuron()) return 0;
53 Double_t result = 0;
54 for (Int_t i=0; i < neuron->NumPreLinks(); i++) {
56 result += val*val;
57 }
58 return result;
59 }
60
61 // name of the class
62 TString GetName() { return "Sum of weighted activations squared"; }
63
64 ClassDef(TNeuronInputSqSum,0); // Calculates square of weighted sum of neuron inputs
65 };
66
67} // namespace TMVA
68
69#endif
#define ClassDef(name, id)
Definition: Rtypes.h:335
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
TNeuron input calculator – calculates the squared weighted sum of inputs.
Double_t GetInput(const TNeuron *neuron) const
Interface for TNeuron input calculation classes.
Definition: TNeuronInput.h:42
Neuron class used by TMVA artificial neural network methods.
Definition: TNeuron.h:49
Bool_t IsInputNeuron() const
Definition: TNeuron.h:116