OTB
9.0.0
Orfeo Toolbox
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Variables
a
c
d
f
g
h
i
l
m
n
p
r
s
t
u
v
Typedefs
b
c
d
f
g
i
k
l
m
n
p
r
s
u
v
z
Enumerations
Enumerator
a
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
u
v
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
b
c
d
f
h
i
l
m
o
p
s
t
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
a
b
c
e
f
g
i
l
m
n
o
r
Files
File List
File Members
All
_
b
c
d
e
f
g
i
l
m
o
p
r
s
t
u
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
_
b
c
d
g
i
o
r
t
u
Examples
Modules
Learning
SOM
include
otbCzihoSOMLearningBehaviorFunctor.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3
* Copyright (C) 2007-2012 Institut Mines Telecom / Telecom Bretagne
4
*
5
* This file is part of Orfeo Toolbox
6
*
7
* https://www.orfeo-toolbox.org/
8
*
9
* Licensed under the Apache License, Version 2.0 (the "License");
10
* you may not use this file except in compliance with the License.
11
* You may obtain a copy of the License at
12
*
13
* http://www.apache.org/licenses/LICENSE-2.0
14
*
15
* Unless required by applicable law or agreed to in writing, software
16
* distributed under the License is distributed on an "AS IS" BASIS,
17
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
* See the License for the specific language governing permissions and
19
* limitations under the License.
20
*/
21
22
23
#ifndef otbCzihoSOMLearningBehaviorFunctor_h
24
#define otbCzihoSOMLearningBehaviorFunctor_h
25
26
#include "itkSize.h"
27
#include "
otbMath.h
"
28
29
namespace
otb
30
{
31
32
namespace
Functor
33
{
34
65
class
CzihoSOMLearningBehaviorFunctor
66
{
67
public
:
69
CzihoSOMLearningBehaviorFunctor
()
70
{
71
m_IterationThreshold
= 0;
72
}
73
virtual
~CzihoSOMLearningBehaviorFunctor
()
74
{
75
}
77
79
unsigned
int
GetIterationThreshold
()
80
{
81
return
this->
m_IterationThreshold
;
82
}
83
84
template
<
unsigned
int
VDimension>
85
void
SetIterationThreshold
(
const
itk::Size<VDimension>& sizeInit,
unsigned
int
iterMax)
86
{
87
double
V0 =
static_cast<
double
>
(sizeInit[0]);
88
for
(
unsigned
int
i = 1; i < VDimension; ++i)
89
{
90
if
(V0 <
static_cast<
double
>
(sizeInit[i]))
91
V0 =
static_cast<
double
>
(sizeInit[i]);
92
}
93
94
m_IterationThreshold
=
static_cast<
unsigned
int
>
(
static_cast<
double
>
(iterMax) * (1.0 - 1.0 / ::std::sqrt(V0)));
95
}
96
98
virtual
double
operator()
(
unsigned
int
currentIteration,
unsigned
int
numberOfIterations,
double
betaInit,
double
betaEnd)
const
99
{
100
if
(currentIteration <
m_IterationThreshold
)
101
{
102
return
betaInit * (1.0 -
static_cast<
double
>
(currentIteration) /
static_cast<
double
>
(numberOfIterations));
103
}
104
else
105
{
106
return
betaEnd * (1.0 -
static_cast<
double
>
(currentIteration -
m_IterationThreshold
) /
static_cast<
double
>
(numberOfIterations -
m_IterationThreshold
));
107
}
108
}
110
111
private
:
112
unsigned
int
m_IterationThreshold
;
113
114
};
// end of class CzihoSOMLearningBehaviorFunctor
115
116
}
// end namespace Functor
117
118
}
// end namespace otb
119
120
#endif
otb::Functor::CzihoSOMLearningBehaviorFunctor::SetIterationThreshold
void SetIterationThreshold(const itk::Size< VDimension > &sizeInit, unsigned int iterMax)
Definition:
otbCzihoSOMLearningBehaviorFunctor.h:85
otb::Functor::CzihoSOMLearningBehaviorFunctor::operator()
virtual double operator()(unsigned int currentIteration, unsigned int numberOfIterations, double betaInit, double betaEnd) const
Definition:
otbCzihoSOMLearningBehaviorFunctor.h:98
otb::Functor::CzihoSOMLearningBehaviorFunctor::GetIterationThreshold
unsigned int GetIterationThreshold()
Definition:
otbCzihoSOMLearningBehaviorFunctor.h:79
otb::Functor::CzihoSOMLearningBehaviorFunctor
Beta behavior over SOM training phase.
Definition:
otbCzihoSOMLearningBehaviorFunctor.h:65
otbMath.h
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition:
otbJoinContainer.h:32
otb::Functor::CzihoSOMLearningBehaviorFunctor::CzihoSOMLearningBehaviorFunctor
CzihoSOMLearningBehaviorFunctor()
Definition:
otbCzihoSOMLearningBehaviorFunctor.h:69
otb::Functor::CzihoSOMLearningBehaviorFunctor::~CzihoSOMLearningBehaviorFunctor
virtual ~CzihoSOMLearningBehaviorFunctor()
Definition:
otbCzihoSOMLearningBehaviorFunctor.h:73
otb::Functor::CzihoSOMLearningBehaviorFunctor::m_IterationThreshold
unsigned int m_IterationThreshold
Definition:
otbCzihoSOMLearningBehaviorFunctor.h:112
Generated at Wed Feb 28 2024 15:21:45 for
OTB
with
1.8.17