Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TNeuronInputSum.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::TNeuronInputSum *
8 * *
9 * *
10 * Description: *
11 * TNeuron input calculator -- calculates the weighted sum of inputs. *
12 * *
13 * Authors (alphabetical): *
14 * Matt Jachowski <jachowski@stanford.edu> - Stanford University, USA *
15 * *
16 * Copyright (c) 2005: *
17 * CERN, Switzerland *
18 * *
19 * Redistribution and use in source and binary forms, with or without *
20 * modification, are permitted according to the terms listed in LICENSE *
21 * (see tmva/doc/LICENSE) *
22 **********************************************************************************/
23
24
25#ifndef ROOT_TMVA_TNeuronInputSum
26#define ROOT_TMVA_TNeuronInputSum
27
28//////////////////////////////////////////////////////////////////////////
29// //
30// TNeuronInputSum //
31// //
32// TNeuron input calculator -- calculates the weighted sum of inputs //
33// //
34//////////////////////////////////////////////////////////////////////////
35
36#include "TMVA/TNeuronInput.h"
37#include "TMVA/TNeuron.h"
38
39namespace TMVA {
40
42
43 public:
44
46 virtual ~TNeuronInputSum() {}
47
48 // calculate input value for neuron
49 Double_t GetInput( const TNeuron* neuron ) const {
50 if (neuron->IsInputNeuron()) return 0;
51 Double_t result = 0;
52 Int_t npl = neuron->NumPreLinks();
53 for (Int_t i=0; i < npl; i++) {
54 result += neuron->PreLinkAt(i)->GetWeightedValue();
55 }
56 return result;
57 }
58
59 // name of class
60 TString GetName() { return "Sum of weighted activations"; }
61
62 ClassDef(TNeuronInputSum,0); // Calculates weighted sum of neuron inputs
63 };
64
65} // namespace TMVA
66
67#endif
#define ClassDef(name, id)
Definition Rtypes.h:337
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 weighted sum of inputs.
Double_t GetInput(const TNeuron *neuron) const
Interface for TNeuron input calculation classes.
Neuron class used by TMVA artificial neural network methods.
Definition TNeuron.h:49
Bool_t IsInputNeuron() const
Definition TNeuron.h:116
Int_t NumPreLinks() const
Definition TNeuron.h:108
TSynapse * PreLinkAt(Int_t index) const
Definition TNeuron.h:110
Double_t GetWeightedValue()
get output of pre-neuron weighted by synapse weight
Definition TSynapse.cxx:76
Basic string class.
Definition TString.h:139
create variable transformations