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

itkTwoHiddenLayerBackPropagationNeuralNetwork.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkTwoHiddenLayerBackPropagationNeuralNetwork.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/08/02 19:17:37 $
00007   Version:   $Revision: 1.1 $
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 #ifndef __TwoHiddenLayerBackPropNeuralNetworkBase_h
00018 #define __TwoHiddenLayerBackPropNeuralNetworkBase_h
00019 
00020 #include "itkMultilayerNeuralNetworkBase.h"
00021 #include "itkBackPropagationLayer.h"
00022 #include "itkCompletelyConnectedWeightSet.h"
00023 #include "itkSigmoidTransferFunction.h"
00024 #include "itkLogSigmoidTransferFunction.h"
00025 #include "itkTanSigmoidTransferFunction.h"
00026 #include "itkHardLimitTransferFunction.h"
00027 #include "itkSignedHardLimitTransferFunction.h"
00028 #include "itkGaussianTransferFunction.h"
00029 #include "itkIdentityTransferFunction.h"
00030 #include "itkSumInputFunction.h"
00031 #include "itkProductInputFunction.h"
00032 
00033 namespace itk
00034 {
00035 namespace Statistics
00036 {
00037 
00038 template<class TVector, class TOutput>
00039 class TwoHiddenLayerBackPropagationNeuralNetwork : public MultilayerNeuralNetworkBase<TVector, TOutput>
00040 {
00041 public:
00042 
00043   typedef itk::Statistics::BackPropagationLayer<TVector, TOutput> LayerType;
00044   typedef itk::Statistics::CompletelyConnectedWeightSet<TVector, TOutput> WeightType;
00045 
00046   typedef TwoHiddenLayerBackPropagationNeuralNetwork Self;
00047   typedef MultilayerNeuralNetworkBase<TVector, TOutput> Superclass;
00048   typedef SmartPointer<Self> Pointer;
00049   typedef SmartPointer<const Self> ConstPointer;
00050 
00051   /* Method for creation through the object factory. */
00052   itkTypeMacro(TwoHiddenLayerBackPropagationNeuralNetwork,
00053                MultilayerNeuralNetworkBase);  
00054   itkNewMacro(Self) ;
00055 
00056   typedef typename Superclass::ValueType ValueType;
00057 
00058   //Add the layers to the network.
00059   // 1 input, 1 hidden, 1 output 
00060   void Initialize();
00061 
00062   itkSetMacro(NumOfInputNodes, int);
00063   itkGetConstReferenceMacro(NumOfInputNodes, int);
00064 
00065   itkSetMacro(NumOfHiddenNodes1, int);
00066   itkGetConstReferenceMacro(NumOfHiddenNodes1, int);
00067 
00068   itkSetMacro(NumOfHiddenNodes2, int);
00069   itkGetConstReferenceMacro(NumOfHiddenNodes2, int);
00070 
00071   itkSetMacro(NumOfOutputNodes, int);
00072   itkGetConstReferenceMacro(NumOfOutputNodes, int);
00073 
00074   ValueType* GenerateOutput(TVector samplevector);
00075 
00076 protected:
00077 
00078   TwoHiddenLayerBackPropagationNeuralNetwork();
00079   ~TwoHiddenLayerBackPropagationNeuralNetwork() {};
00080   
00082   virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00083 
00084 private:
00085 
00086   int m_NumOfInputNodes;
00087   int m_NumOfHiddenNodes1;
00088   int m_NumOfHiddenNodes2;
00089   int m_NumOfOutputNodes;
00090 };
00091 
00092 } // end namespace Statistics
00093 } // end namespace itk
00094 
00095 #ifndef ITK_MANUAL_INSTANTIATION
00096   #include "itkTwoHiddenLayerBackPropagationNeuralNetwork.txx"
00097 #endif
00098 
00099 #endif
00100 

Generated at Thu May 25 00:10:04 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000