Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Static Public Attributes
dnnlowp::Tanh< T > Class Template Reference

We use the 3-region approach described in "Efficient VLSI Implementation of Neural Networks with Hyperbolic Tangent Activation Function", IEEE Transactions on Very Large Scale Integration Systems, Zamanlooy and Mirhassani. More...

#include <tanh.h>

Public Member Functions

 Tanh (double max_abs_err=DEFAULT_MAX_ABS_ERR)
 
T Compute (T x) const
 
TensorQuantizationParams GetInputQuantizationParams () const
 
TensorQuantizationParams GetOutputQuantizationParams () const
 
int GetPassRegionEnd () const
 
float GetPassRegionEndDequantized () const
 
float GetSaturationRegionBegin () const
 

Static Public Attributes

static constexpr double DEFAULT_MAX_ABS_ERR = 0.02
 
static constexpr int DEFAULT_NUM_IN_BITS = 8
 
static constexpr int DEFAULT_NUM_OUT_BITS = 8
 

Detailed Description

template<typename T>
class dnnlowp::Tanh< T >

We use the 3-region approach described in "Efficient VLSI Implementation of Neural Networks with Hyperbolic Tangent Activation Function", IEEE Transactions on Very Large Scale Integration Systems, Zamanlooy and Mirhassani.

The pass region (x < x_pq) is approximated as x. The saturation region (x >= x_sq) is approximated as 1. The processing region (x_pq <= x < x_sq) is divided into sub-ranges and the average value of tanh(x) is used per sub-range.

Definition at line 21 of file tanh.h.


The documentation for this class was generated from the following files: