HYPERLATTICES

Logo

Generalized Lattice data-types for Common Lisp, including Algebraic Lattices, Hyperlattices, and Probabilistic Hyperlattices, which intends to follow the packages-as-types convention.

View the Project on GitHub thephoeron/hyperlattices

Activation Functions for Hyperlattices

Common Activation Functions for Probabilistic Hyperlattices

Common activation functions used in probabilistic hyperlattices include the sigmoid function, the rectified linear unit (ReLU) function, and the hyperbolic tangent (tanh) function. Here’s an example of how you can implement these activation functions in Common Lisp:

(defun sigmoid (x)
  "Compute the sigmoid function of x."
  (/ 1.0 (+ 1.0 (exp (- x)))))

(defun relu (x)
  "Compute the rectified linear unit function of x."
  (max 0 x))

(defun tanh (x)
  "Compute the hyperbolic tangent function of x."
  (/ (- (exp x) (exp (- x))) (+ (exp x) (exp (- x)))))

In this code, the sigmoid function computes the sigmoid function of a given input x, which is defined as 1 / (1 + exp(-x)). The relu function computes the rectified linear unit function of a given input x, which is defined as max(0, x). The tanh function computes the hyperbolic tangent function of a given input x, which is defined as (exp(x) - exp(-x)) / (exp(x) + exp(-x)).

These activation functions can be used in the definition of the hyperlattice model, for example, as the activation function of the nodes in the hidden layers of a neural network.