~ubuntu-branches/ubuntu/precise/insighttoolkit/precise

« back to all changes in this revision

Viewing changes to Code/Numerics/NeuralNetworks/itkTrainingFunctionBase.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2008-05-31 12:07:29 UTC
  • mfrom: (3.1.3 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080531120729-7g7layn480le43ko
Tags: 3.6.0-3
* debian/patches/gccxml-workaround.patch: New.  Work around gccxml issue
  with #include_next; c.f. http://www.gccxml.org/Bug/view.php?id=7134.  
* debian/patches/gcc43.patch: include <cstring> in itkNeighbourhood.h.
  This only showed up in the tcl wrapping step.

* Above two entries fix FTBFS for GCC 4.3-based systems.
  Closes: #478500.

* debian/patches/sharedforward.patch: New.  Ensure that linux/sparc
  systems are not also configured as a SUN sparc system, which requires
  SUN header sys/isa_defs.h.  Closes: #478940, #483312.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
  Program:   Insight Segmentation & Registration Toolkit
4
4
  Module:    $RCSfile: itkTrainingFunctionBase.h,v $
5
5
  Language:  C++
6
 
  Date:      $Date: 2006/04/18 11:23:29 $
7
 
  Version:   $Revision: 1.6 $
 
6
  Date:      $Date: 2007-08-17 13:10:57 $
 
7
  Version:   $Revision: 1.7 $
8
8
 
9
9
  Copyright (c) Insight Software Consortium. All rights reserved.
10
10
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
28
28
namespace Statistics
29
29
{
30
30
 
31
 
template<class TSample, class TOutput, class ScalarType>
 
31
template<class TSample, class TTargetVector, class ScalarType>
32
32
class TrainingFunctionBase : public LightProcessObject
33
33
{
34
34
public:
45
45
 
46
46
  typedef ScalarType ValueType;
47
47
  typedef typename TSample::MeasurementVectorType VectorType;
48
 
  typedef typename TOutput::MeasurementVectorType OutputVectorType;
 
48
  typedef typename TTargetVector::MeasurementVectorType OutputVectorType;
49
49
  typedef Array<ValueType> InternalVectorType;
50
50
 
51
51
  typedef std::vector<VectorType> InputSampleVectorType;
56
56
  //typedef MeanSquaredErrorFunction<InternalVectorType, ScalarType> DefaultPerformanceType;
57
57
 
58
58
  void SetTrainingSamples(TSample* samples);
59
 
  void SetTargetValues(TOutput* targets);
 
59
  void SetTargetValues(TTargetVector* targets);
60
60
  void SetLearningRate(ValueType);
61
61
 
62
62
  ValueType GetLearningRate();
66
66
 
67
67
  void SetPerformanceFunction(PerformanceFunctionType* f);
68
68
 
69
 
  virtual void
70
 
  Train(NetworkType* itkNotUsed(net), TSample* itkNotUsed(samples), TOutput* itkNotUsed(targets))
 
69
  virtual void Train(NetworkType* itkNotUsed(net), TSample* itkNotUsed(samples), TTargetVector* itkNotUsed(targets))
71
70
    {
72
71
    // not implemented
73
72
    };
84
83
    }
85
84
 
86
85
  inline OutputVectorType
87
 
  targetconverter(typename TOutput::MeasurementVectorType v)
 
86
  targetconverter(typename TTargetVector::MeasurementVectorType v)
88
87
    {
89
88
    OutputVectorType temp;
90
89
    
104
103
  virtual void PrintSelf( std::ostream& os, Indent indent ) const;
105
104
 
106
105
  TSample*                m_TrainingSamples;// original samples
107
 
  TOutput*                m_SampleTargets;  // original samples
 
106
  TTargetVector*                m_SampleTargets;  // original samples
108
107
  InputSampleVectorType   m_InputSamples;   // itk::vectors
109
108
  OutputSampleVectorType  m_Targets;        // itk::vectors
110
109
  long                    m_Iterations;