MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / activation

Function activation

src/core/helpers/LUTManager.cpp:42–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40};
41
42inline float16_t activation(float16_t x, const LUTInfo &info)
43{
44 float16_t out = 0.f;
45 switch (info.act)
46 {
47 case ActivationLayerInfo::ActivationFunction::LOGISTIC:
48 out = 1.f / (1.f + std::exp(-x));
49 break;
50 case ActivationLayerInfo::ActivationFunction::TANH:
51 {
52 out = static_cast<float16_t>(info.alpha * std::tanh(info.beta * x));
53 break;
54 }
55 default:
56 ARM_COMPUTE_ERROR("Unsupported Activation for 16-bit LUT table");
57 break;
58 }
59 return out;
60}
61
62inline float exponential(float fp, const LUTInfo &info)
63{

Callers 1

init_lutFunction · 0.85

Calls 2

expFunction · 0.85
tanhFunction · 0.85

Tested by

no test coverage detected