Logo ROOT   6.10/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 #include "TObject.h"
16 
17 class TNeuron;
18 
19 //____________________________________________________________________
20 //
21 // TSynapse
22 //
23 // This is a simple weighted bidirectionnal connection between
24 // two neurons.
25 // A network is built connecting two neurons by a synapse.
26 // In addition to the value, the synapse can return the DeDw
27 //
28 //____________________________________________________________________
29 
30 class TSynapse : public TObject {
31  public:
32  TSynapse();
33  TSynapse(TNeuron*, TNeuron*, Double_t w = 1);
34  virtual ~TSynapse() {}
35  void SetPre(TNeuron* pre);
36  void SetPost(TNeuron* post);
37  inline TNeuron* GetPre() const { return fpre; }
38  inline TNeuron* GetPost() const { return fpost; }
39  void SetWeight(Double_t w);
40  inline Double_t GetWeight() const { return fweight; }
41  Double_t GetValue() const;
42  Double_t GetDeDw() const;
43  void SetDEDw(Double_t in);
44  Double_t GetDEDw() const { return fDEDw; }
45 
46  private:
47  TNeuron* fpre; // the neuron before the synapse
48  TNeuron* fpost; // the neuron after the synapse
49  Double_t fweight; // the weight of the synapse
50  Double_t fDEDw; //! the derivative of the total error wrt the synapse weight
51 
52  ClassDef(TSynapse, 1) // simple weighted bidirectionnal connection between 2 neurons
53 };
54 
55 #endif
TNeuron * fpre
Definition: TSynapse.h:47
Double_t fweight
Definition: TSynapse.h:49
virtual ~TSynapse()
Definition: TSynapse.h:34
Double_t GetValue() const
Returns the value: weithted input.
Definition: TSynapse.cxx:82
Double_t GetDeDw() const
Computes the derivative of the error wrt the synapse weight.
Definition: TSynapse.cxx:92
#define ClassDef(name, id)
Definition: Rtypes.h:297
void SetPre(TNeuron *pre)
Sets the pre-neuron.
Definition: TSynapse.cxx:56
TNeuron * GetPost() const
Definition: TSynapse.h:38
TSynapse()
Default constructor.
Definition: TSynapse.cxx:32
void SetPost(TNeuron *post)
Sets the post-neuron.
Definition: TSynapse.cxx:69
TNeuron * fpost
Definition: TSynapse.h:48
TNeuron * GetPre() const
Definition: TSynapse.h:37
void SetWeight(Double_t w)
Sets the weight of the synapse.
Definition: TSynapse.cxx:105
Double_t GetWeight() const
Definition: TSynapse.h:40
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:50
Double_t GetDEDw() const
Definition: TSynapse.h:44
Mother of all ROOT objects.
Definition: TObject.h:37