00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkNeuralNetworkObject.h,v $ 00005 Language: C++ 00006 Date: $Date: 2006/04/17 19:34:45 $ 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 __NeuralNetworkObject_h 00019 #define __NeuralNetworkObject_h 00020 00021 #include "itkDataObject.h" 00022 #include "itkLayerBase.h" 00023 #include "itkWeightSetBase.h" 00024 #include "itkLearningFunctionBase.h" 00025 00026 namespace itk 00027 { 00028 namespace Statistics 00029 { 00030 template<class TVector, class TOutput> 00031 class NeuralNetworkObject : public DataObject 00032 { 00033 public: 00034 00035 typedef NeuralNetworkObject Self; 00036 typedef DataObject Superclass; 00037 typedef SmartPointer<Self> Pointer; 00038 typedef SmartPointer<const Self> ConstPointer; 00039 itkTypeMacro(NeuralNetworkObject, DataObject); 00040 00041 typedef typename TVector::ValueType ValueType; 00042 typedef TOutput TargetVectorType; 00043 typedef Array<ValueType> NetworkOutputType; 00044 00045 typedef WeightSetBase<TVector, TOutput> WeightSetType; 00046 typedef LayerBase<TVector, TOutput> LayerType; 00047 typedef typename LayerType::Pointer LayerPointer; 00048 typedef typename WeightSetType::Pointer WeightSetPointer; 00049 typedef LearningFunctionBase<LayerType, TOutput> LearningFunctionType; 00050 typedef typename LearningFunctionType::Pointer LearningFunctionPointer; 00051 00052 //virtual ValueType* GenerateOutput(TVector samplevector) = 0; 00053 virtual NetworkOutputType GenerateOutput(TVector samplevector)=0; 00054 00055 //virtual void BackwardPropagate(TOutput errors) = 0; 00056 virtual void BackwardPropagate(NetworkOutputType errors) = 0; 00057 virtual void UpdateWeights(ValueType) = 0; 00058 00059 protected: 00060 00061 NeuralNetworkObject(); 00062 ~NeuralNetworkObject(); 00063 00065 virtual void PrintSelf( std::ostream& os, Indent indent ) const; 00066 00067 ValueType m_LearningRate; 00068 00069 }; 00070 00071 } // end namespace Statistics 00072 } // end namespace itk 00073 00074 #ifndef ITK_MANUAL_INSTANTIATION 00075 #include "itkNeuralNetworkObject.txx" 00076 #endif 00077 00078 #endif 00079