ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkRBFBackPropagationLearningFunction.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkRBFBackPropagationLearningFunction_h
00019 #define __itkRBFBackPropagationLearningFunction_h
00020 
00021 #include <iostream>
00022 #include "itkLearningFunctionBase.h"
00023 #include "itkRBFLayer.h"
00024 
00025 namespace itk
00026 {
00027 namespace Statistics
00028 {
00035 template<class LayerType, class TTargetVector>
00036 class RBFBackPropagationLearningFunction : public LearningFunctionBase<LayerType, TTargetVector>
00037 {
00038 public:
00039 
00040   typedef RBFBackPropagationLearningFunction             Self;
00041   typedef LearningFunctionBase<LayerType, TTargetVector> Superclass;
00042   typedef SmartPointer<Self>                             Pointer;
00043   typedef SmartPointer<const Self>                       ConstPointer;
00044 
00045   typedef typename LayerType::LayerInterfaceType LayerInterfaceType;
00047   itkTypeMacro(RBFBackPropagationLearningFunction, LearningFunctionBase);
00048 
00050   itkNewMacro(Self);
00051 
00052   typedef typename Superclass::ValueType ValueType;
00053 
00054   virtual void Learn(LayerType* layer,ValueType learningrate);
00055   virtual void Learn(LayerType* layer, TTargetVector error, ValueType learningrate);
00056 
00057   itkSetMacro(LearningRate1, ValueType);
00058   itkGetMacro(LearningRate1, ValueType);
00059   itkSetMacro(LearningRate2, ValueType);
00060   itkGetMacro(LearningRate2, ValueType);
00061   itkSetMacro(LearningRate3, ValueType);
00062   itkGetMacro(LearningRate3, ValueType);
00063 
00064 protected:
00065 
00066   RBFBackPropagationLearningFunction();
00067   virtual ~RBFBackPropagationLearningFunction() {};
00068 
00070   virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00071 
00072 private:
00073 
00074   ValueType             m_LearningRate1;   // output weights
00075   ValueType             m_LearningRate2;   // centers
00076   ValueType             m_LearningRate3;   // widths
00077   vnl_vector<ValueType> m_OutputErrors;
00078 
00079 };
00080 
00081 } // end namespace Statistics
00082 } // end namespace itk
00083 
00084 #ifndef ITK_MANUAL_INSTANTIATION
00085 #include "itkRBFBackPropagationLearningFunction.hxx"
00086 #endif
00087 
00088 #endif
00089