ROOT logo
// @(#)root/tmva $Id: TActivationTanh.h 29122 2009-06-22 06:51:30Z brun $
// Author: Matt Jachowski 

/**********************************************************************************
 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
 * Package: TMVA                                                                  *
 * Class  : TMVA::TActivationTanh                                                 *
 * Web    : http://tmva.sourceforge.net                                           *
 *                                                                                *
 * Description:                                                                   *
 *      Tanh activation function for TNeuron                                      *
 *                                                                                *
 * Authors (alphabetical):                                                        *
 *      Matt Jachowski  <jachowski@stanford.edu> - Stanford University, USA       *
 *                                                                                *
 * Copyright (c) 2005:                                                            *
 *      CERN, Switzerland                                                         *
 *                                                                                *
 * Redistribution and use in source and binary forms, with or without             *
 * modification, are permitted according to the terms listed in LICENSE           *
 * (http://tmva.sourceforge.net/LICENSE)                                          *
 **********************************************************************************/ 

#ifndef ROOT_TMVA_TActivationTanh
#define ROOT_TMVA_TActivationTanh

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TActivationTanh                                                      //
//                                                                      //
// Tanh activation function for TNeuron                                 //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TFormula
#include "TFormula.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif

#ifndef ROOT_TMVA_TActivation
#include "TMVA/TActivation.h"
#endif

namespace TMVA {
  
   class TActivationTanh : public TActivation {
    
   public:

      TActivationTanh();
      ~TActivationTanh();

      // evaluate the activation function
      Double_t Eval(Double_t arg);

      // evaluate the derivative of the activation function
      Double_t EvalDerivative(Double_t arg);

      // minimum of the range of the activation function
      Double_t GetMin() { return -1; }

      // maximum of the range of the activation function
      Double_t GetMax() { return 1; }

      // expression for the activation function
      TString GetExpression();

      // writer of function code
      virtual void MakeFunction(std::ostream& fout, const TString& fncName);

   private:

      TFormula* fEqn;             // equation of tanh sigmoid
      TFormula* fEqnDerivative;   // equation of tanh sigmoid derivative

      ClassDef(TActivationTanh,0) // Tanh sigmoid activation function for TNeuron
   };

} // namespace TMVA

#endif
 TActivationTanh.h:1
 TActivationTanh.h:2
 TActivationTanh.h:3
 TActivationTanh.h:4
 TActivationTanh.h:5
 TActivationTanh.h:6
 TActivationTanh.h:7
 TActivationTanh.h:8
 TActivationTanh.h:9
 TActivationTanh.h:10
 TActivationTanh.h:11
 TActivationTanh.h:12
 TActivationTanh.h:13
 TActivationTanh.h:14
 TActivationTanh.h:15
 TActivationTanh.h:16
 TActivationTanh.h:17
 TActivationTanh.h:18
 TActivationTanh.h:19
 TActivationTanh.h:20
 TActivationTanh.h:21
 TActivationTanh.h:22
 TActivationTanh.h:23
 TActivationTanh.h:24
 TActivationTanh.h:25
 TActivationTanh.h:26
 TActivationTanh.h:27
 TActivationTanh.h:28
 TActivationTanh.h:29
 TActivationTanh.h:30
 TActivationTanh.h:31
 TActivationTanh.h:32
 TActivationTanh.h:33
 TActivationTanh.h:34
 TActivationTanh.h:35
 TActivationTanh.h:36
 TActivationTanh.h:37
 TActivationTanh.h:38
 TActivationTanh.h:39
 TActivationTanh.h:40
 TActivationTanh.h:41
 TActivationTanh.h:42
 TActivationTanh.h:43
 TActivationTanh.h:44
 TActivationTanh.h:45
 TActivationTanh.h:46
 TActivationTanh.h:47
 TActivationTanh.h:48
 TActivationTanh.h:49
 TActivationTanh.h:50
 TActivationTanh.h:51
 TActivationTanh.h:52
 TActivationTanh.h:53
 TActivationTanh.h:54
 TActivationTanh.h:55
 TActivationTanh.h:56
 TActivationTanh.h:57
 TActivationTanh.h:58
 TActivationTanh.h:59
 TActivationTanh.h:60
 TActivationTanh.h:61
 TActivationTanh.h:62
 TActivationTanh.h:63
 TActivationTanh.h:64
 TActivationTanh.h:65
 TActivationTanh.h:66
 TActivationTanh.h:67
 TActivationTanh.h:68
 TActivationTanh.h:69
 TActivationTanh.h:70
 TActivationTanh.h:71
 TActivationTanh.h:72
 TActivationTanh.h:73
 TActivationTanh.h:74
 TActivationTanh.h:75
 TActivationTanh.h:76
 TActivationTanh.h:77
 TActivationTanh.h:78
 TActivationTanh.h:79
 TActivationTanh.h:80
 TActivationTanh.h:81
 TActivationTanh.h:82
 TActivationTanh.h:83