pymlkit
API reference

Activations

The four activation functions.

Activations is an enum passed to add_dense.

python
from pymlkit import Activations
MemberFormulaTypical use
ReLUmax(0, x)Hidden layers.
Sigmoid1 / (1 + e^-x)Single-output binary classification.
Softmaxe^xᵢ / Σ e^xⱼOutput layer for multi-class classification.
LinearxRegression outputs. The default.
The enum also has a NONE member. It exists for parity with the C library and is not meant for normal use.

Choosing one

  • Regression: hidden ReLU, output Linear, loss HalfMSE.
  • Binary classification: hidden ReLU, output Sigmoid, loss HalfMSE or CrossEntropy.
  • Multi-class: hidden ReLU, output Softmax, loss CrossEntropy.