Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkRBFNetwork.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRBFNetwork.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/04/18 11:23:29 $
00007   Version:   $Revision: 1.4 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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   typedef TransferFunctionBase<ValueType> TransferFunctionType;
00053   typedef RadialBasisFunctionBase<ValueType> RBFType;
00054   typedef InputFunctionBase<ValueType*, ValueType> InputFunctionType;
00055   typedef EuclideanDistance<ArrayType> DistanceMetricType; 
00056 
00057   typename InputFunctionType::Pointer InputFunction;
00058   typename DistanceMetricType::Pointer DistanceMetric;
00059   
00060   typename TransferFunctionType::Pointer InputTransferFunction;
00061   typename RBFType::Pointer HiddenTransferFunction;
00062   typename TransferFunctionType::Pointer OutputTransferFunction;
00063   
00064   typedef typename Superclass::NetworkOutputType NetworkOutputType;
00065 
00066   /* Method for creation through the object factory. */
00067   itkTypeMacro(RBFNetwork,
00068                MultilayerNeuralNetworkBase);  
00069   itkNewMacro(Self) ;
00070 
00071   //Add the layers to the network.
00072   // 1 input, 1 hidden, 1 output 
00073   void Initialize();
00074 
00075   itkSetMacro(NumOfInputNodes, int);
00076   itkGetConstReferenceMacro(NumOfInputNodes, int);
00077 
00078   itkSetMacro(NumOfHiddenNodes, int);
00079   itkGetConstReferenceMacro(NumOfHiddenNodes, int);
00080 
00081   itkSetMacro(NumOfOutputNodes, int);
00082   itkGetConstReferenceMacro(NumOfOutputNodes, int);
00083 
00084   itkSetMacro(HiddenLayerBias, ValueType);
00085   itkGetConstReferenceMacro(HiddenLayerBias, ValueType);
00086 
00087   itkSetMacro(OutputLayerBias, ValueType);
00088   itkGetConstReferenceMacro(OutputLayerBias, ValueType);
00089 
00090   itkSetMacro(Classes, int);
00091   itkGetConstReferenceMacro(Classes,int);
00092 
00093  // ValueType* GenerateOutput(TVector samplevector);
00094   virtual NetworkOutputType GenerateOutput(TVector samplevector);
00095 
00096   void SetInputTransferFunction(TransferFunctionType* f);
00097   void SetDistanceMetric(DistanceMetricType* f);
00098   void SetHiddenTransferFunction(TransferFunctionType* f);
00099   void SetOutputTransferFunction(TransferFunctionType* f);
00100 
00101   void SetInputFunction(InputFunctionType* f);
00102   void InitializeWeights();
00103 
00104   void SetCenter(TVector c);
00105   void SetRadius(ValueType r);
00106 
00107 protected:
00108 
00109   RBFNetwork();
00110   ~RBFNetwork(){};
00111   
00113   virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00114 
00115 private:
00116 
00117   int       m_NumOfInputNodes;
00118   int       m_NumOfHiddenNodes;
00119   int       m_NumOfOutputNodes;
00120   int       m_Classes;
00121   ValueType m_HiddenLayerBias;
00122   ValueType m_OutputLayerBias;
00123   std::vector<TVector> m_Centers;  // ui....uc
00124   std::vector<double> m_Radii;
00125 };
00126 
00127 } // end namespace Statistics
00128 } // end namespace itk
00129 
00130 #ifndef ITK_MANUAL_INSTANTIATION
00131 #include "itkRBFNetwork.txx"
00132 #endif
00133 
00134 #endif
00135 

Generated at Fri Sep 8 03:57:56 2006 for ITK by doxygen 1.4.7 written by Dimitri van Heesch, © 1997-2000