ROOT   Reference Guide
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 * Web : http://tmva.sourceforge.net *
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 *
22 **********************************************************************************/
23
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
40
41////////////////////////////////////////////////////////////////////////////////
42/// evaluate gaussian
43
45{
46 return TMath::Exp(-arg * arg * 0.5);
47}
48
49////////////////////////////////////////////////////////////////////////////////
50/// evaluate derivative
51
53{
54 return -arg*TMath::Exp(-arg * arg * 0.5);
55}
56
57////////////////////////////////////////////////////////////////////////////////
58/// get expressions for the gaussian and its derivatives
59
61{
62 TString expr = "TMath::Exp(-x^2/2.0)\t\t-x*TMath::Exp(-x^2/2.0)";
63 return expr;
64}
65
66////////////////////////////////////////////////////////////////////////////////
67/// writes the sigmoid activation function source code
68
69void TMVA::TActivationRadial::MakeFunction( std::ostream& fout, const TString& fncName )
70{
71 fout << "double " << fncName << "(double x) const {" << std::endl;
72 fout << " // radial" << std::endl;
73 fout << " return exp(-x*x/2.0);" << std::endl;
74 fout << "}" << std::endl;
75}
#define ClassImp(name)
Definition: Rtypes.h:375
Radial basis activation function for ANN.
virtual void MakeFunction(std::ostream &fout, const TString &fncName)
writes the sigmoid activation function source code
Double_t Eval(Double_t arg)
evaluate gaussian
Double_t EvalDerivative(Double_t arg)
evaluate derivative
TString GetExpression()
get expressions for the gaussian and its derivatives
Basic string class.
Definition: TString.h:136
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:706