ActivationFunction class abstract

The abstract base class (or interface) for all activation functions.

The purpose of this class is to define a common contract that all activation functions, such as ReLU, Sigmoid, or Tanh, must follow.

By having this common interface, layers like DenseLayer can be written to work with any activation function, making the framework modular and easy to extend with new, custom activations.

Example

// Both layers accept an object that implements ActivationFunction.
Layer denseWithReLU = DenseLayer(64, activation: ReLU());
Layer denseWithTanh = DenseLayer(64, activation: Tanh());
Implementers

Constructors

ActivationFunction()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(Tensor input) Tensor
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited