Loading [MathJax]/extensions/tex2jax.js
ROOT
6.12/07
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
+
Namespaces
Namespace List
+
Namespace 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
l
m
n
o
p
q
r
s
u
w
x
+
Enumerations
a
e
f
g
m
p
t
w
y
+
Enumerator
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
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
u
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
n
o
p
r
s
v
w
+
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
TActivationReLU.cxx
Go to the documentation of this file.
1
// @(#)root/tmva $Id$
2
// Author: Helge Voss
3
4
/**********************************************************************************
5
* Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6
* Package: TMVA *
7
* Class : TActivationReLU *
8
* Web : http://tmva.sourceforge.net *
9
* *
10
* Description: *
11
* Rectified linear unit function for an ANN. *
12
* *
13
* Authors (alphabetical): *
14
* Helge Voss *
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
/*! \class TMVA::TActivationReLU
25
\ingroup TMVA
26
Rectified Linear Unit activation function for TNeuron
27
*/
28
29
#include "
TMVA/TActivationReLU.h
"
30
31
#include "
TMVA/TActivation.h
"
32
33
#include "TFormula.h"
34
#include "
TMath.h
"
35
#include "
TString.h
"
36
37
#include <iostream>
38
39
ClassImp
(
TMVA::TActivationReLU
);
40
41
////////////////////////////////////////////////////////////////////////////////
42
/// constructor for ReLU
43
44
TMVA::TActivationReLU::TActivationReLU
()
45
{
46
// sorry, I really don't know what I would possibly want to do here ;)
47
48
}
49
50
////////////////////////////////////////////////////////////////////////////////
51
/// destructor
52
53
TMVA::TActivationReLU::~TActivationReLU
()
54
{
55
}
56
57
////////////////////////////////////////////////////////////////////////////////
58
/// get expressions for the tanh and its derivative
59
60
TString
TMVA::TActivationReLU::GetExpression
()
61
{
62
TString
expr =
"max(0,x)"
;
63
64
return
expr;
65
}
66
67
////////////////////////////////////////////////////////////////////////////////
68
/// writes the sigmoid activation function source code
69
70
void
TMVA::TActivationReLU::MakeFunction
( std::ostream& fout,
const
TString
& fncName )
71
{
72
fout <<
"double "
<< fncName <<
"(double x) const {"
<< std::endl;
73
fout <<
" // rectified linear unit"
<< std::endl;
74
fout <<
" return x>0 ? x : 0; "
<< std::endl;
75
fout <<
"}"
<< std::endl;
76
}
TActivationReLU.h
TMVA::TActivationReLU::~TActivationReLU
~TActivationReLU()
destructor
Definition:
TActivationReLU.cxx:53
TString
Basic string class.
Definition:
TString.h:125
TString.h
TActivation.h
TMVA::TActivationReLU::GetExpression
TString GetExpression()
get expressions for the tanh and its derivative
Definition:
TActivationReLU.cxx:60
TMVA::TActivationReLU
Rectified Linear Unit activation function for TNeuron.
Definition:
TActivationReLU.h:42
TMVA::TActivationReLU::TActivationReLU
TActivationReLU()
constructor for ReLU
Definition:
TActivationReLU.cxx:44
ClassImp
#define ClassImp(name)
Definition:
Rtypes.h:359
TMVA::TActivationReLU::MakeFunction
virtual void MakeFunction(std::ostream &fout, const TString &fncName)
writes the sigmoid activation function source code
Definition:
TActivationReLU.cxx:70
TMath.h