00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __TwoHiddenLayerBackPropNeuralNetworkBase_h
00018 #define __TwoHiddenLayerBackPropNeuralNetworkBase_h
00019
00020 #include "itkMultilayerNeuralNetworkBase.h"
00021 #include "itkBackPropagationLayer.h"
00022 #include "itkCompletelyConnectedWeightSet.h"
00023 #include "itkSigmoidTransferFunction.h"
00024 #include "itkLogSigmoidTransferFunction.h"
00025 #include "itkTanSigmoidTransferFunction.h"
00026 #include "itkHardLimitTransferFunction.h"
00027 #include "itkSignedHardLimitTransferFunction.h"
00028 #include "itkGaussianTransferFunction.h"
00029 #include "itkIdentityTransferFunction.h"
00030 #include "itkSumInputFunction.h"
00031 #include "itkProductInputFunction.h"
00032
00033 namespace itk
00034 {
00035 namespace Statistics
00036 {
00037
00038 template<class TVector, class TOutput>
00039 class TwoHiddenLayerBackPropagationNeuralNetwork : public MultilayerNeuralNetworkBase<TVector, TOutput>
00040 {
00041 public:
00042
00043 typedef itk::Statistics::BackPropagationLayer<TVector, TOutput> LayerType;
00044 typedef itk::Statistics::CompletelyConnectedWeightSet<TVector, TOutput> WeightType;
00045
00046 typedef TwoHiddenLayerBackPropagationNeuralNetwork Self;
00047 typedef MultilayerNeuralNetworkBase<TVector, TOutput> Superclass;
00048 typedef SmartPointer<Self> Pointer;
00049 typedef SmartPointer<const Self> ConstPointer;
00050
00051 typedef typename Superclass::NetworkOutputType NetworkOutputType;
00052
00053
00054 itkTypeMacro(TwoHiddenLayerBackPropagationNeuralNetwork,
00055 MultilayerNeuralNetworkBase);
00056 itkNewMacro(Self) ;
00057
00058 typedef typename Superclass::ValueType ValueType;
00059
00060
00061
00062 void Initialize();
00063
00064 itkSetMacro(NumOfInputNodes,unsigned int);
00065 itkGetConstReferenceMacro(NumOfInputNodes,unsigned int);
00066
00067 itkSetMacro(NumOfHiddenNodes1, unsigned int);
00068 itkGetConstReferenceMacro(NumOfHiddenNodes1,unsigned int);
00069
00070 itkSetMacro(NumOfHiddenNodes2, unsigned int);
00071 itkGetConstReferenceMacro(NumOfHiddenNodes2,unsigned int);
00072
00073 itkSetMacro(NumOfOutputNodes,unsigned int);
00074 itkGetConstReferenceMacro(NumOfOutputNodes,unsigned int);
00075
00076
00077 virtual NetworkOutputType GenerateOutput(TVector samplevector);
00078
00079 protected:
00080
00081 TwoHiddenLayerBackPropagationNeuralNetwork();
00082 ~TwoHiddenLayerBackPropagationNeuralNetwork() {};
00083
00085 virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00086
00087 private:
00088
00089 unsigned int m_NumOfInputNodes;
00090 unsigned int m_NumOfHiddenNodes1;
00091 unsigned int m_NumOfHiddenNodes2;
00092 unsigned int m_NumOfOutputNodes;
00093 };
00094
00095 }
00096 }
00097
00098 #ifndef ITK_MANUAL_INSTANTIATION
00099 #include "itkTwoHiddenLayerBackPropagationNeuralNetwork.txx"
00100 #endif
00101
00102 #endif
00103
00104