ROOT
6.10/09
Reference Guide
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:129
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
ClassImp
#define ClassImp(name)
Definition:
Rtypes.h:336
TMVA::TActivationReLU::MakeFunction
virtual void MakeFunction(std::ostream &fout, const TString &fncName)
writes the sigmoid activation function source code
Definition:
TActivationReLU.cxx:70
TMVA
Abstract ClassifierFactory template that handles arbitrary types.
Definition:
GeneticMinimizer.h:21
TMath.h