ROOT
6.07/09
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
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
#include "
TMVA/TActivationReLU.h
"
25
26
#include "
TMVA/TActivation.h
"
27
28
#include "TFormula.h"
29
#include "
TMath.h
"
30
#include "
TString.h
"
31
32
#include <iostream>
33
34
ClassImp
(
TMVA::TActivationReLU
)
35
36
////////////////////////////////////////////////////////////////////////////////
37
/// constructor for ReLU
38
39
TMVA
::
TActivationReLU
::
TActivationReLU
()
40
{
41
// sorry, I really don't know what I would possibly want to do here ;)
42
43
}
44
45
////////////////////////////////////////////////////////////////////////////////
46
/// destructor
47
48
TMVA::TActivationReLU::~TActivationReLU
()
49
{
50
}
51
52
////////////////////////////////////////////////////////////////////////////////
53
/// get expressions for the tanh and its derivative
54
55
TString
TMVA::TActivationReLU::GetExpression
()
56
{
57
TString
expr =
"max(0,x)"
;
58
59
return
expr;
60
}
61
62
////////////////////////////////////////////////////////////////////////////////
63
/// writes the sigmoid activation function source code
64
65
void
TMVA::TActivationReLU::MakeFunction
( std::ostream& fout,
const
TString
& fncName )
66
{
67
fout <<
"double "
<< fncName <<
"(double x) const {"
<< std::endl;
68
fout <<
" // rectified linear unit"
<< std::endl;
69
fout <<
" return x>0 ? x : 0; "
<< std::endl;
70
fout <<
"}"
<< std::endl;
71
}
TActivationReLU.h
TMVA::TActivationReLU::~TActivationReLU
~TActivationReLU()
destructor
Definition:
TActivationReLU.cxx:48
TString
Basic string class.
Definition:
TString.h:137
TString.h
TActivation.h
TMVA::TActivationReLU::GetExpression
TString GetExpression()
get expressions for the tanh and its derivative
Definition:
TActivationReLU.cxx:55
TMVA::TActivationReLU
Definition:
TActivationReLU.h:48
ClassImp
#define ClassImp(name)
Definition:
Rtypes.h:279
TMVA::TActivationReLU::MakeFunction
virtual void MakeFunction(std::ostream &fout, const TString &fncName)
writes the sigmoid activation function source code
Definition:
TActivationReLU.cxx:65
TMVA
Abstract ClassifierFactory template that handles arbitrary types.
Definition:
GeneticMinimizer.h:21
TMath.h