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

itkOneHiddenLayerBackPropagationNeuralNetwork.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkOneHiddenLayerBackPropagationNeuralNetwork.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/08/03 14:40:14 $
00007   Version:   $Revision: 1.2 $
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 __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   /* Method for creation through the object factory. */
00058   itkTypeMacro(OneHiddenLayerBackPropagationNeuralNetwork,
00059                MultilayerNeuralNetworkBase);  
00060   itkNewMacro(Self) ;
00061 
00062   //Add the layers to the network.
00063   // 1 input, 1 hidden, 1 output 
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 } // end namespace Statistics
00112 } // end namespace itk
00113 
00114 #ifndef ITK_MANUAL_INSTANTIATION
00115   #include "itkOneHiddenLayerBackPropagationNeuralNetwork.txx"
00116 #endif
00117 
00118 #endif

Generated at Wed May 24 23:48:15 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000