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 :
00044 public MultilayerNeuralNetworkBase<TVector, TOutput>
00045 {
00046
00047 public:
00048
00049 typedef OneHiddenLayerBackPropagationNeuralNetwork Self;
00050 typedef MultilayerNeuralNetworkBase<TVector, TOutput> Superclass;
00051 typedef SmartPointer<Self> Pointer;
00052 typedef SmartPointer<const Self> ConstPointer;
00053 typedef typename Superclass::ValueType ValueType;
00054 typedef typename Superclass::NetworkOutputType NetworkOutputType;
00055
00056 typedef TransferFunctionBase<ValueType> TransferFunctionType;
00057 typedef InputFunctionBase<ValueType*, ValueType> InputFunctionType;
00058
00059
00060 itkTypeMacro(OneHiddenLayerBackPropagationNeuralNetwork,
00061 MultilayerNeuralNetworkBase);
00062 itkNewMacro(Self) ;
00063
00064
00065
00066 void Initialize();
00067
00068 itkSetMacro(NumOfInputNodes, unsigned int);
00069 itkGetConstReferenceMacro(NumOfInputNodes, unsigned int);
00070
00071 itkSetMacro(NumOfHiddenNodes, unsigned int);
00072 itkGetConstReferenceMacro(NumOfHiddenNodes, unsigned int);
00073
00074 itkSetMacro(NumOfOutputNodes, unsigned int);
00075 itkGetConstReferenceMacro(NumOfOutputNodes, unsigned int);
00076
00077 itkSetMacro(HiddenLayerBias, ValueType);
00078 itkGetConstReferenceMacro(HiddenLayerBias, ValueType);
00079
00080 itkSetMacro(OutputLayerBias, ValueType);
00081 itkGetConstReferenceMacro(OutputLayerBias, ValueType);
00082
00083
00084 NetworkOutputType GenerateOutput(TVector samplevector);
00085
00086 void SetInputTransferFunction(TransferFunctionType* f);
00087 void SetHiddenTransferFunction(TransferFunctionType* f);
00088 void SetOutputTransferFunction(TransferFunctionType* f);
00089
00090 void SetInputFunction(InputFunctionType* f);
00091
00092 protected:
00093
00094 OneHiddenLayerBackPropagationNeuralNetwork();
00095 ~OneHiddenLayerBackPropagationNeuralNetwork(){};
00096
00098 virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00099
00100 private:
00101
00102 unsigned int m_NumOfInputNodes;
00103 unsigned int m_NumOfHiddenNodes;
00104 unsigned int m_NumOfOutputNodes;
00105 ValueType m_HiddenLayerBias;
00106 ValueType m_OutputLayerBias;
00107
00108 typename InputFunctionType::Pointer m_InputFunction;
00109 typename TransferFunctionType::Pointer m_InputTransferFunction;
00110 typename TransferFunctionType::Pointer m_HiddenTransferFunction;
00111 typename TransferFunctionType::Pointer m_OutputTransferFunction;
00112 };
00113
00114 }
00115 }
00116
00117 #ifndef ITK_MANUAL_INSTANTIATION
00118 #include "itkOneHiddenLayerBackPropagationNeuralNetwork.txx"
00119 #endif
00120
00121 #endif
00122