Orfeo Toolbox
3.16
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
OTB
Code
Learning
otbSVMCrossValidationCostFunction.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: ORFEO Toolbox
4
Language: C++
5
Date: $Date$
6
Version: $Revision$
7
8
9
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10
See OTBCopyright.txt for details.
11
12
13
This software is distributed WITHOUT ANY WARRANTY; without even
14
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
PURPOSE. See the above copyright notices for more information.
16
17
=========================================================================*/
18
#ifndef __otbSVMCrossValidationCostFunction_h
19
#define __otbSVMCrossValidationCostFunction_h
20
21
#include "
otbSVMModel.h
"
22
#include "
itkSingleValuedCostFunction.h
"
23
24
namespace
otb
25
{
26
48
template
<
class
TModel>
49
class
ITK_EXPORT
SVMCrossValidationCostFunction
50
:
public
itk::SingleValuedCostFunction
51
{
52
public
:
54
typedef
SVMCrossValidationCostFunction
Self
;
55
typedef
itk::SingleValuedCostFunction
Superclass
;
56
typedef
itk::SmartPointer<Self>
Pointer
;
57
typedef
itk::SmartPointer<const Self>
ConstPointer
;
58
60
itkNewMacro(
Self
);
61
63
typedef
TModel
SVMModelType
;
64
typedef
typename
SVMModelType::Pointer
SVMModelPointer
;
65
67
typedef
typename
Superclass::MeasureType
MeasurementType
;
68
typedef
typename
Superclass::ParametersType
ParametersType
;
69
typedef
typename
Superclass::ParametersValueType
ParametersValueType
;
70
typedef
typename
Superclass::DerivativeType
DerivativeType
;
71
73
itkSetObjectMacro(Model,
SVMModelType
);
74
itkGetObjectMacro(Model,
SVMModelType
);
75
77
itkSetMacro(NumberOfCrossValidationFolders,
unsigned
int
);
78
itkGetMacro(NumberOfCrossValidationFolders,
unsigned
int
);
79
81
itkSetMacro(DerivativeStep,
ParametersValueType
);
82
itkGetMacro(DerivativeStep,
ParametersValueType
);
83
85
virtual
MeasureType
GetValue(
const
ParametersType
& parameters)
const
;
86
88
virtual
void
GetDerivative(
const
ParametersType
& parameters,
DerivativeType
& derivative)
const
;
89
91
virtual
unsigned
int
GetNumberOfParameters(
void
)
const
;
92
93
protected
:
95
SVMCrossValidationCostFunction
();
97
virtual
~
SVMCrossValidationCostFunction
();
98
101
virtual
void
UpdateParameters(
struct
svm_parameter
& svm_parameters,
const
ParametersType
& parameters)
const
;
102
103
private
:
104
SVMCrossValidationCostFunction
(
const
Self
&);
//purposely not implemented
105
void
operator =(
const
Self
&);
//purposely not implemented
106
108
SVMModelPointer
m_Model
;
109
111
unsigned
int
m_NumberOfCrossValidationFolders
;
112
114
ParametersValueType
m_DerivativeStep
;
115
116
};
// class SVMCrossValidationCostFunction
117
118
}
// namespace otb
119
120
#ifndef OTB_MANUAL_INSTANTIATION
121
#include "
otbSVMCrossValidationCostFunction.txx
"
122
#endif
123
124
#endif
Generated at Sun Feb 3 2013 00:50:58 for
Orfeo Toolbox
with
doxygen 1.8.1.1