ROOT
master
Reference Guide
Loading...
Searching...
No Matches
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
* *
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
* (see tmva/doc/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 "
TString.h
"
34
35
#include <iostream>
36
37
38
////////////////////////////////////////////////////////////////////////////////
39
/// get expressions for the tanh and its derivative
40
41
TString
TMVA::TActivationReLU::GetExpression
()
42
{
43
TString
expr
=
"max(0,x)"
;
44
45
return
expr
;
46
}
47
48
////////////////////////////////////////////////////////////////////////////////
49
/// writes the Rectified Linear Unit activation function source code
50
51
void
TMVA::TActivationReLU::MakeFunction
( std::ostream&
fout
,
const
TString
&
fncName
)
52
{
53
fout
<<
"double "
<<
fncName
<<
"(double x) const {"
<< std::endl;
54
fout
<<
" // rectified linear unit"
<< std::endl;
55
fout
<<
" return x>0 ? x : 0; "
<< std::endl;
56
fout
<<
"}"
<< std::endl;
57
}
TActivationReLU.h
TActivation.h
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
TString.h
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TMVA::TActivationReLU::MakeFunction
void MakeFunction(std::ostream &fout, const TString &fncName) override
writes the Rectified Linear Unit activation function source code
Definition
TActivationReLU.cxx:51
TMVA::TActivationReLU::GetExpression
TString GetExpression() override
get expressions for the tanh and its derivative
Definition
TActivationReLU.cxx:41
TString
Basic string class.
Definition
TString.h:138
tmva
tmva
src
TActivationReLU.cxx
ROOT master - Reference Guide Generated on Mon Sep 22 2025 04:32:23 (GVA Time) using Doxygen 1.10.0