ROOT  6.06/09
Reference Guide
TSynapse.h
Go to the documentation of this file.
1 // @(#)root/mlp:$Id$
2 // Author: Christophe.Delaere@cern.ch 20/07/2003
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2003, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TSynapse
13 #define ROOT_TSynapse
14 
15 #ifndef ROOT_TObject
16 #include "TObject.h"
17 #endif
18 
19 class TNeuron;
20 
21 //____________________________________________________________________
22 //
23 // TSynapse
24 //
25 // This is a simple weighted bidirectionnal connection between
26 // two neurons.
27 // A network is built connecting two neurons by a synapse.
28 // In addition to the value, the synapse can return the DeDw
29 //
30 //____________________________________________________________________
31 
32 class TSynapse : public TObject {
33  public:
34  TSynapse();
35  TSynapse(TNeuron*, TNeuron*, Double_t w = 1);
36  virtual ~TSynapse() {}
37  void SetPre(TNeuron* pre);
38  void SetPost(TNeuron* post);
39  inline TNeuron* GetPre() const { return fpre; }
40  inline TNeuron* GetPost() const { return fpost; }
41  void SetWeight(Double_t w);
42  inline Double_t GetWeight() const { return fweight; }
43  Double_t GetValue() const;
44  Double_t GetDeDw() const;
45  void SetDEDw(Double_t in);
46  Double_t GetDEDw() const { return fDEDw; }
47 
48  private:
49  TNeuron* fpre; // the neuron before the synapse
50  TNeuron* fpost; // the neuron after the synapse
51  Double_t fweight; // the weight of the synapse
52  Double_t fDEDw; //! the derivative of the total error wrt the synapse weight
53 
54  ClassDef(TSynapse, 1) // simple weighted bidirectionnal connection between 2 neurons
55 };
56 
57 #endif
TNeuron * fpre
Definition: TSynapse.h:49
Double_t fweight
Definition: TSynapse.h:51
virtual ~TSynapse()
Definition: TSynapse.h:36
Double_t GetDEDw() const
Definition: TSynapse.h:46
#define ClassDef(name, id)
Definition: Rtypes.h:254
TNeuron * GetPost() const
Definition: TSynapse.h:40
void SetPre(TNeuron *pre)
Sets the pre-neuron.
Definition: TSynapse.cxx:56
void SetPost(TNeuron *post)
Sets the post-neuron.
Definition: TSynapse.cxx:69
Double_t GetDeDw() const
Computes the derivative of the error wrt the synapse weight.
Definition: TSynapse.cxx:92
TNeuron * fpost
Definition: TSynapse.h:50
void SetWeight(Double_t w)
Sets the weight of the synapse.
Definition: TSynapse.cxx:105
void SetDEDw(Double_t in)
Sets the derivative of the total error wrt the synapse weight.
Definition: TSynapse.cxx:113
double Double_t
Definition: RtypesCore.h:55
Double_t fDEDw
Definition: TSynapse.h:52
Mother of all ROOT objects.
Definition: TObject.h:58
TNeuron * GetPre() const
Definition: TSynapse.h:39
Double_t GetWeight() const
Definition: TSynapse.h:42
Double_t GetValue() const
Returns the value: weithted input.
Definition: TSynapse.cxx:82