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