LCFIVertex  0.7.2
TanSigmoidNeuron.h
1 #ifndef TANSIGMOIDNEURON_H
2 #define TANSIGMOIDNEURON_H
3 
4 #include "NeuralNetConfig.h"
5 #include "Neuron.h"
6 
7 #ifdef __CINT__
8 #include "NeuralNet.h"
9 #else
10 //namespace nnet added 15/08/06 by Mark Grimes (mark.grimes@bristol.ac.uk) for the LCFI vertex package
11 namespace nnet
12 {
13 class NeuralNet;
14 }
15 #endif
16 
17 #include <iostream>
18 #include <string>
19 
20 //namespace nnet added 15/08/06 by Mark Grimes (mark.grimes@bristol.ac.uk) for the LCFI vertex package
21 namespace nnet
22 {
23 
24 class
25 #ifndef __CINT__
26 NEURALNETDLL
27 #endif
29  public Neuron
30 {
31 public:
32  TanSigmoidNeuron(const int numberOfInputs,const double bias=-1.0,const double scale=1.0,const NeuralNet *parent=0);
33  ~TanSigmoidNeuron(void);
34  void setScale(const double newScale) {_scale = newScale;}
35  double scale() {return _scale;}
36  void destroy() const;
37  Neuron *clone(const NeuralNet *parentNetwork) const;
38  void outputRange(double &outputmin,double &outputmax) const
39  { outputmin = -1.0; outputmax = 1.0;}
40 
41 protected:
42  double thresholdFunction(const double activation) const;
43  double derivative(const double x) const;
44  void serialiseExtra(std::ostream &os) const;
45  std::string neuronType() const {return "TanSigmoidNeuron";}
46 
47 private:
48  TanSigmoidNeuron(const TanSigmoidNeuron &other); // Declared but not defined
49  double _scale;
50 };
51 
52 }//namespace nnet
53 
54 #endif