Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TActivationRadial.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 : TActivationRadial *
8 * *
9 * *
10 * Description: *
11 * Radial basis activation function for TNeuron *
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 * (see tmva/doc/LICENSE) *
22 **********************************************************************************/
23
24/*! \class TMVA::TActivationRadial
25\ingroup TMVA
26Radial basis activation function for ANN.
27*/
28
30
31#include "TMVA/TActivation.h"
32
33#include "TMath.h"
34#include "TString.h"
35
36#include <iostream>
37
38
39
40////////////////////////////////////////////////////////////////////////////////
41/// evaluate gaussian
42
44{
45 return TMath::Exp(-arg * arg * 0.5);
46}
47
48////////////////////////////////////////////////////////////////////////////////
49/// evaluate derivative
50
52{
53 return -arg*TMath::Exp(-arg * arg * 0.5);
54}
55
56////////////////////////////////////////////////////////////////////////////////
57/// get expressions for the gaussian and its derivatives
58
60{
61 TString expr = "TMath::Exp(-x^2/2.0)\t\t-x*TMath::Exp(-x^2/2.0)";
62 return expr;
63}
64
65////////////////////////////////////////////////////////////////////////////////
66/// writes the sigmoid activation function source code
67
69{
70 fout << "double " << fncName << "(double x) const {" << std::endl;
71 fout << " // radial" << std::endl;
72 fout << " return exp(-x*x/2.0);" << std::endl;
73 fout << "}" << std::endl;
74}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Double_t EvalDerivative(Double_t arg) override
evaluate derivative
TString GetExpression() override
get expressions for the gaussian and its derivatives
Double_t Eval(Double_t arg) override
evaluate gaussian
void MakeFunction(std::ostream &fout, const TString &fncName) override
writes the sigmoid activation function source code
Basic string class.
Definition TString.h:138
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Definition TMath.h:720