00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkOneHiddenLayerBackPropNeuralNetworkBase_h
00019 #define __itkOneHiddenLayerBackPropNeuralNetworkBase_h
00020
00021
00022 #include "itkMultilayerNeuralNetworkBase.h"
00023 #include "itkBackPropagationLayer.h"
00024 #include "itkCompletelyConnectedWeightSet.h"
00025 #include "itkSigmoidTransferFunction.h"
00026 #include "itkLogSigmoidTransferFunction.h"
00027 #include "itkSymmetricSigmoidTransferFunction.h"
00028 #include "itkTanSigmoidTransferFunction.h"
00029 #include "itkHardLimitTransferFunction.h"
00030 #include "itkSignedHardLimitTransferFunction.h"
00031 #include "itkGaussianTransferFunction.h"
00032 #include "itkTanHTransferFunction.h"
00033 #include "itkIdentityTransferFunction.h"
00034 #include "itkSumInputFunction.h"
00035 #include "itkProductInputFunction.h"
00036
00037 namespace itk
00038 {
00039 namespace Statistics
00040 {
00041
00042 template<class TVector, class TOutput>
00043 class OneHiddenLayerBackPropagationNeuralNetwork : public MultilayerNeuralNetworkBase<TVector, TOutput>
00044 {
00045
00046 public:
00047
00048 typedef OneHiddenLayerBackPropagationNeuralNetwork Self;
00049 typedef MultilayerNeuralNetworkBase<TVector, TOutput> Superclass;
00050 typedef SmartPointer<Self> Pointer;
00051 typedef SmartPointer<const Self> ConstPointer;
00052 typedef typename Superclass::ValueType ValueType;
00053
00054 typedef TransferFunctionBase<ValueType> TransferFunctionType;
00055 typedef InputFunctionBase<ValueType*, ValueType> InputFunctionType;
00056
00057
00058 itkTypeMacro(OneHiddenLayerBackPropagationNeuralNetwork,
00059 MultilayerNeuralNetworkBase);
00060 itkNewMacro(Self) ;
00061
00062
00063
00064 void Initialize();
00065
00066 itkSetMacro(NumOfInputNodes, int);
00067 itkGetConstReferenceMacro(NumOfInputNodes, int);
00068
00069 itkSetMacro(NumOfHiddenNodes, int);
00070 itkGetConstReferenceMacro(NumOfHiddenNodes, int);
00071
00072 itkSetMacro(NumOfOutputNodes, int);
00073 itkGetConstReferenceMacro(NumOfOutputNodes, int);
00074
00075 itkSetMacro(HiddenLayerBias, ValueType);
00076 itkGetConstReferenceMacro(HiddenLayerBias, ValueType);
00077
00078 itkSetMacro(OutputLayerBias, ValueType);
00079 itkGetConstReferenceMacro(OutputLayerBias, ValueType);
00080
00081 ValueType* GenerateOutput(TVector samplevector);
00082
00083 void SetInputTransferFunction(TransferFunctionType* f);
00084 void SetHiddenTransferFunction(TransferFunctionType* f);
00085 void SetOutputTransferFunction(TransferFunctionType* f);
00086
00087 void SetInputFunction(InputFunctionType* f);
00088
00089 protected:
00090
00091 OneHiddenLayerBackPropagationNeuralNetwork();
00092 ~OneHiddenLayerBackPropagationNeuralNetwork(){};
00093
00095 virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00096
00097 private:
00098
00099 int m_NumOfInputNodes;
00100 int m_NumOfHiddenNodes;
00101 int m_NumOfOutputNodes;
00102 ValueType m_HiddenLayerBias;
00103 ValueType m_OutputLayerBias;
00104
00105 typename InputFunctionType::Pointer m_InputFunction;
00106 typename TransferFunctionType::Pointer m_InputTransferFunction;
00107 typename TransferFunctionType::Pointer m_HiddenTransferFunction;
00108 typename TransferFunctionType::Pointer m_OutputTransferFunction;
00109 };
00110
00111 }
00112 }
00113
00114 #ifndef ITK_MANUAL_INSTANTIATION
00115 #include "itkOneHiddenLayerBackPropagationNeuralNetwork.txx"
00116 #endif
00117
00118 #endif