18 #ifndef itkMultilayerNeuralNetworkBase_h
19 #define itkMultilayerNeuralNetworkBase_h
33 template<
typename TMeasurementVector,
typename TTargetVector,
typename TLearningLayer=LayerBase<TMeasurementVector, TTargetVector> >
49 typedef typename Superclass::ValueType
ValueType;
60 typedef std::vector<typename LayerInterfaceType::WeightSetInterfaceType::Pointer>
62 typedef std::vector<typename LayerInterfaceType::Pointer>
69 #ifdef __USE_OLD_INTERFACE
70 itkSetMacro(NumOfLayers,
int);
71 itkGetConstReferenceMacro(NumOfLayers,
int);
73 itkSetMacro(NumOfWeightSets,
int);
74 itkGetConstReferenceMacro(NumOfWeightSets,
int);
78 return m_Layers.size();
82 return m_Weights.size();
87 void AddLayer(LayerInterfaceType *);
88 LayerInterfaceType * GetLayer(
int layer_id);
89 const LayerInterfaceType * GetLayer(
int layer_id)
const;
91 void AddWeightSet(
typename LayerInterfaceType::WeightSetInterfaceType*);
94 return m_Weights[id].GetPointer();
96 #ifdef __USE_OLD_INTERFACE
97 const typename LayerInterfaceType::WeightSetInterfaceType* GetWeightSet(
unsigned int id)
const;
100 void SetLearningFunction(LearningFunctionInterfaceType* f);
102 virtual NetworkOutputType GenerateOutput(TMeasurementVector samplevector) ITK_OVERRIDE;
104 virtual void BackwardPropagate(NetworkOutputType errors) ITK_OVERRIDE;
105 virtual void UpdateWeights(ValueType) ITK_OVERRIDE;
107 void SetLearningRule(LearningFunctionInterfaceType*);
109 void SetLearningRate(ValueType learningrate);
111 void InitializeWeights();
115 ~MultilayerNeuralNetworkBase() ITK_OVERRIDE;
119 typename LearningFunctionInterfaceType::
Pointer m_LearningFunction;
122 #ifdef __USE_OLD_INTERFACE
126 int m_NumOfWeightSets;
129 virtual void PrintSelf( std::ostream& os,
Indent indent )
const ITK_OVERRIDE;
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "itkMultilayerNeuralNetworkBase.hxx"
This is the itkWeightSetBase class.
std::vector< typename LayerInterfaceType::WeightSetInterfaceType::Pointer > WeightVectorType
TLearningLayer LearningLayerType
SmartPointer< const Self > ConstPointer
int GetNumOfWeightSets(void) const
This is the itkTransferFunctionBase class.
MultilayerNeuralNetworkBase Self
Superclass::LayerInterfaceType LayerInterfaceType
Superclass::MeasurementVectorType MeasurementVectorType
InputFunctionBase< ValueType *, ValueType > InputFunctionInterfaceType
int GetNumOfLayers(void) const
Superclass::TargetVectorType TargetVectorType
SmartPointer< Self > Pointer
std::vector< typename LayerInterfaceType::Pointer > LayerVectorType
MeasurementVectorType::ValueType ValueType
This is the itkMultilayerNeuralNetworkBase class.
TransferFunctionBase< ValueType > TransferFunctionInterfaceType
Superclass::NetworkOutputType NetworkOutputType
This is the itkNeuralNetworkObject class.
Control indentation during Print() invocation.
The LearningFunctionBase is the base class for all the learning strategies.
NeuralNetworkObject< TMeasurementVector, TTargetVector > Superclass
LayerInterfaceType::WeightSetInterfaceType * GetWeightSet(unsigned int id)
Base class for all data objects in ITK.
LearningFunctionBase< typename TLearningLayer::LayerInterfaceType, TTargetVector > LearningFunctionInterfaceType
Superclass::ValueType ValueType