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: 2006/04/17 21:34:31 $
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 __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   typedef typename Superclass::NetworkOutputType NetworkOutputType;
00054   
00055   typedef TransferFunctionBase<ValueType> TransferFunctionType;
00056   typedef InputFunctionBase<ValueType*, ValueType> InputFunctionType;
00057   
00058   /* Method for creation through the object factory. */
00059   itkTypeMacro(OneHiddenLayerBackPropagationNeuralNetwork,
00060                MultilayerNeuralNetworkBase);  
00061   itkNewMacro(Self) ;
00062 
00063   //Add the layers to the network.
00064   // 1 input, 1 hidden, 1 output 
00065   void Initialize();
00066 
00067   itkSetMacro(NumOfInputNodes, int);
00068   itkGetConstReferenceMacro(NumOfInputNodes, int);
00069 
00070   itkSetMacro(NumOfHiddenNodes, int);
00071   itkGetConstReferenceMacro(NumOfHiddenNodes, int);
00072 
00073   itkSetMacro(NumOfOutputNodes, int);
00074   itkGetConstReferenceMacro(NumOfOutputNodes, int);
00075 
00076   itkSetMacro(HiddenLayerBias, ValueType);
00077   itkGetConstReferenceMacro(HiddenLayerBias, ValueType);
00078 
00079   itkSetMacro(OutputLayerBias, ValueType);
00080   itkGetConstReferenceMacro(OutputLayerBias, ValueType);
00081 
00082   //ValueType* GenerateOutput(TVector samplevector);
00083   NetworkOutputType GenerateOutput(TVector samplevector);
00084 
00085   void SetInputTransferFunction(TransferFunctionType* f);
00086   void SetHiddenTransferFunction(TransferFunctionType* f);
00087   void SetOutputTransferFunction(TransferFunctionType* f);
00088 
00089   void SetInputFunction(InputFunctionType* f);
00090 
00091 protected:
00092 
00093   OneHiddenLayerBackPropagationNeuralNetwork();
00094   ~OneHiddenLayerBackPropagationNeuralNetwork(){};
00095 
00097   virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00098 
00099 private:
00100 
00101   int       m_NumOfInputNodes;
00102   int       m_NumOfHiddenNodes;
00103   int       m_NumOfOutputNodes;
00104   ValueType m_HiddenLayerBias;
00105   ValueType m_OutputLayerBias;
00106 
00107   typename InputFunctionType::Pointer    m_InputFunction;
00108   typename TransferFunctionType::Pointer m_InputTransferFunction;
00109   typename TransferFunctionType::Pointer m_HiddenTransferFunction;
00110   typename TransferFunctionType::Pointer m_OutputTransferFunction;
00111 };
00112 
00113 } // end namespace Statistics
00114 } // end namespace itk
00115 
00116 #ifndef ITK_MANUAL_INSTANTIATION
00117   #include "itkOneHiddenLayerBackPropagationNeuralNetwork.txx"
00118 #endif
00119 
00120 #endif
00121 

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