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: 2007/01/20 15:28:37 $
00007   Version:   $Revision: 1.6 $
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 : 
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   /* Method for creation through the object factory. */
00060   itkTypeMacro(OneHiddenLayerBackPropagationNeuralNetwork,
00061                MultilayerNeuralNetworkBase);  
00062   itkNewMacro(Self) ;
00063 
00064   //Add the layers to the network.
00065   // 1 input, 1 hidden, 1 output 
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   //ValueType* GenerateOutput(TVector samplevector);
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 } // end namespace Statistics
00115 } // end namespace itk
00116 
00117 #ifndef ITK_MANUAL_INSTANTIATION
00118   #include "itkOneHiddenLayerBackPropagationNeuralNetwork.txx"
00119 #endif
00120 
00121 #endif
00122 

Generated at Mon Mar 12 01:59:33 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000