Loading [MathJax]/extensions/tex2jax.js
ROOT
6.08/07
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
+
Namespaces
Namespace List
+
Namespace Members
+
All
2
3
<
_
a
b
c
d
e
f
g
h
i
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
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
2
3
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
u
v
x
+
Enumerations
a
d
e
f
g
h
m
p
t
v
w
y
+
Enumerator
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
u
v
w
+
All 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
y
z
~
+
Variables
_
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
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
x
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
w
y
+
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Properties
f
+
Related 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
+
Files
File List
+
File Members
+
All
1
2
3
4
5
6
7
8
9
_
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
y
+
Variables
_
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
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerations
c
e
f
i
l
m
p
r
u
x
+
Enumerator
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
v
w
x
y
z
+
Macros
1
2
3
4
5
6
7
8
9
_
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
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
tmva
tmva
src
TActivationChooser.cxx
Go to the documentation of this file.
1
// @(#)root/tmva $Id$
2
// Author: Matt Jachowski
3
4
/**********************************************************************************
5
* Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6
* Package: TMVA *
7
* Class : TMVA::TActivationChooser *
8
* Web : http://tmva.sourceforge.net *
9
* *
10
* Description: *
11
* Class for easily choosing activation functions. *
12
* *
13
* Authors (alphabetical): *
14
* Matt Jachowski <jachowski@stanford.edu> - Stanford University, USA *
15
* *
16
* Copyright (c) 2005: *
17
* CERN, Switzerland *
18
* *
19
* Redistribution and use in source and binary forms, with or without *
20
* modification, are permitted according to the terms listed in LICENSE *
21
* (http://tmva.sourceforge.net/LICENSE) *
22
**********************************************************************************/
23
24
#include "
TMVA/TActivationChooser.h
"
25
26
27
//////////////////////////////////////////////////////////////////////////
28
// //
29
// TActivationChooser //
30
// //
31
// Class for easily choosing activation functions //
32
// //
33
//////////////////////////////////////////////////////////////////////////
34
35
#include <vector>
36
#include "
TString.h
"
37
38
#ifndef ROOT_TMVA_TActivation
39
#include "
TMVA/TActivation.h
"
40
#endif
41
#ifndef ROOT_TMVA_TActivationIdentity
42
#include "
TMVA/TActivationIdentity.h
"
43
#endif
44
#ifndef ROOT_TMVA_TActivationSigmoid
45
#include "
TMVA/TActivationSigmoid.h
"
46
#endif
47
#ifndef ROOT_TMVA_TActivationTanh
48
#include "
TMVA/TActivationTanh.h
"
49
#endif
50
#ifndef ROOT_TMVA_TActivationReLU
51
#include "
TMVA/TActivationReLU.h
"
52
#endif
53
#ifndef ROOT_TMVA_TActivationRadial
54
#include "
TMVA/TActivationRadial.h
"
55
#endif
56
#ifndef ROOT_TMVA_MsgLogger
57
#include "
TMVA/MsgLogger.h
"
58
#endif
59
#include "
TMVA/Types.h
"
60
61
62
TMVA::TActivationChooser::TActivationChooser
() :
63
fLINEAR(
"linear"
),
64
fSIGMOID(
"sigmoid"
),
65
fTANH(
"tanh"
),
66
fRELU(
"ReLU"
),
67
fRADIAL(
"radial"
),
68
fLogger( new
MsgLogger
(
"TActivationChooser"
) )
69
{
70
// defaut constructor
71
}
72
73
TMVA::TActivationChooser::~TActivationChooser
()
74
{
75
// destructor
76
delete
fLogger
;
77
}
78
79
TMVA::TActivation
*
80
TMVA::TActivationChooser::CreateActivation
(
EActivationType
type
)
const
81
{
82
// instantiate the correct activation object according to the
83
// type choosen (given as the enumeration type)
84
85
switch
(type) {
86
case
kLinear
:
return
new
TActivationIdentity
();
87
case
kSigmoid
:
return
new
TActivationSigmoid
();
88
case
kTanh
:
return
new
TActivationTanh
();
89
case
kReLU
:
return
new
TActivationReLU
();
90
case
kRadial
:
return
new
TActivationRadial
();
91
default
:
92
Log
() <<
kFATAL
<<
"no Activation function of type "
<< type <<
" found"
<<
Endl
;
93
return
0;
94
}
95
return
NULL
;
96
}
97
98
TMVA::TActivation
*
99
TMVA::TActivationChooser::CreateActivation
(
const
TString
&
type
)
const
100
{
101
// instantiate the correct activation object according to the
102
// type choosen (given by a TString)
103
104
if
(type ==
fLINEAR
)
return
CreateActivation
(
kLinear
);
105
else
if
(type ==
fSIGMOID
)
return
CreateActivation
(
kSigmoid
);
106
else
if
(type ==
fTANH
)
return
CreateActivation
(
kTanh
);
107
else
if
(type ==
fRELU
)
return
CreateActivation
(
kReLU
);
108
else
if
(type ==
fRADIAL
)
return
CreateActivation
(
kRadial
);
109
else
{
110
Log
() <<
kFATAL
<<
"no Activation function of type "
<< type <<
" found"
<<
Endl
;
111
return
0;
112
}
113
}
114
115
std::vector<TString>*
116
TMVA::TActivationChooser::GetAllActivationNames
()
const
117
{
118
// retuns the names of all know activation functions
119
120
std::vector<TString>* names =
new
std::vector<TString>();
121
names->push_back(
fLINEAR
);
122
names->push_back(
fSIGMOID
);
123
names->push_back(
fTANH
);
124
names->push_back(
fRELU
);
125
names->push_back(
fRADIAL
);
126
return
names;
127
}
128
129
TActivationReLU.h
TMVA::kFATAL
Definition:
Types.h:67
TMVA::TActivationRadial
Definition:
TActivationRadial.h:48
TMVA::Endl
MsgLogger & Endl(MsgLogger &ml)
Definition:
MsgLogger.h:162
Types.h
TMVA::TActivationChooser::EActivationType
EActivationType
Definition:
TActivationChooser.h:49
TActivationSigmoid.h
TString
Basic string class.
Definition:
TString.h:137
TMVA::TActivationChooser::Log
MsgLogger & Log() const
message logger
Definition:
TActivationChooser.h:72
TMVA::TActivationChooser::kTanh
Definition:
TActivationChooser.h:51
TMVA::TActivationSigmoid
Definition:
TActivationSigmoid.h:48
TMVA::TActivationChooser::kSigmoid
Definition:
TActivationChooser.h:50
TMVA::TActivationChooser::kLinear
Definition:
TActivationChooser.h:49
TMVA::TActivationChooser::fLINEAR
TString fLINEAR
Definition:
TActivationChooser.h:65
TMVA::TActivationChooser::CreateActivation
TActivation * CreateActivation(EActivationType type) const
Definition:
TActivationChooser.cxx:80
TMVA::TActivationChooser::~TActivationChooser
virtual ~TActivationChooser()
Definition:
TActivationChooser.cxx:73
TString.h
TMVA::TActivationTanh
Definition:
TActivationTanh.h:48
TActivation.h
TMVA::TActivationChooser::fTANH
TString fTANH
Definition:
TActivationChooser.h:67
TMVA::TActivationIdentity
Definition:
TActivationIdentity.h:48
TMVA::TActivationReLU
Definition:
TActivationReLU.h:48
TMVA::TActivationChooser::fSIGMOID
TString fSIGMOID
Definition:
TActivationChooser.h:66
TMVA::TActivationChooser::TActivationChooser
TActivationChooser()
Definition:
TActivationChooser.cxx:62
MsgLogger.h
TActivationIdentity.h
TMVA::TActivationChooser::fRADIAL
TString fRADIAL
Definition:
TActivationChooser.h:69
TMVA::TActivationChooser::fRELU
TString fRELU
Definition:
TActivationChooser.h:68
TActivationTanh.h
type
int type
Definition:
TGX11.cxx:120
TMVA::MsgLogger
Definition:
MsgLogger.h:63
TMVA::TActivationChooser::GetAllActivationNames
std::vector< TString > * GetAllActivationNames() const
Definition:
TActivationChooser.cxx:116
TMVA::TActivationChooser::kRadial
Definition:
TActivationChooser.h:53
TActivationRadial.h
NULL
#define NULL
Definition:
Rtypes.h:82
TMVA::TActivationChooser::fLogger
MsgLogger * fLogger
Definition:
TActivationChooser.h:71
TMVA::TActivationChooser::kReLU
Definition:
TActivationChooser.h:52
TMVA::TActivation
Definition:
TActivation.h:46
TActivationChooser.h