mltk.core.TfliteActivation

class TfliteActivation[source]

Activation types

This may be instantiated with either an integer OR string, e.g.:

activation = TfliteActivation(0)
activation = TfliteActivation('relu')

Properties

NONE

No activation, linear pass through

RELU

Rectified Linear Unit, f(x) = max(0, x)

RELU_N1_TO_1

Rectified Linear Unit, -1 to 1, f(x) = min(max(-1, x), 1)

RELU6

Rectified Linear Unit, 0 to 6, f(x) = min(max(0, x), 6)

TANH

Hyperbolic Tangent, f(x) = tanh(x)

SIGN_BIT

Sigmoid, f(x) = e^x / (e^x + 1)

Methods

to_string

Return the activation as a string

NONE = 0

No activation, linear pass through

RELU = 1

Rectified Linear Unit, f(x) = max(0, x)

RELU_N1_TO_1 = 2

Rectified Linear Unit, -1 to 1, f(x) = min(max(-1, x), 1)

RELU6 = 3

Rectified Linear Unit, 0 to 6, f(x) = min(max(0, x), 6)

TANH = 4

Hyperbolic Tangent, f(x) = tanh(x)

SIGN_BIT = 5

Sigmoid, f(x) = e^x / (e^x + 1)

to_string()[source]

Return the activation as a string

Return type:

str