Crate utils

Source
Expand description

A suite of utilities tailored toward neural networks.

Our focus revolves around the following areas:

  • Numerical Operations: Efficient implementations of mathematical functions.
  • Statistical Functions: Tools for statistical analysis and operations.
  • Signal Processing: Functions and utilities for signal manipulation.
  • Utilities: General-purpose utilities to aid in mathematical computations.

Modules§

error
ops
prelude
stats
Statistical primitives and utilities commonly used in machine learning.

Macros§

toggle

Enums§

UtilityError

Traits§

Abs
AsComplex
Conjugate
Cos
Cosh
Cubed
Exp
FloorDiv
IntoComplex
Trait for converting a type into a complex number.
PercentDiff
Compute the percentage difference between two values. The percentage difference is defined as:
Root
RoundTo
Sine
Sinh
SquareRoot
Squared
Tan
Tanh

Functions§

calculate_pattern_similarity
Calculate similarity between two patterns
clip_gradient
Clip the gradient to a maximum value.
clip_inf_nan
concat_iter
Creates an n-dimensional array from an iterator of n dimensional arrays.
extract_patterns
Extract common patterns from historical sequences
floor_div
divide two values and round down to the nearest integer.
genspace
heavyside
Heaviside activation function
hstack
stack a 1D array into a 2D array by stacking them horizontally.
inverse
is_similar_pattern
Check if two patterns are similar enough to be considered duplicates
layer_norm
layer_norm_axis
linarr
relu
the relu activation function: $f(x) = \max(0, x)$
relu_derivative
round_to
Round the given value to the given number of decimal places.
sigmoid
the sigmoid activation function: $f(x) = \frac{1}{1 + e^{-x}}$
sigmoid_derivative
the derivative of the sigmoid function
softmax
Softmax function: $f(x_i) = \frac{e^{x_i}}{\sum_j e^{x_j}}$
softmax_axis
Softmax function along a specific axis: $f(x_i) = \frac{e^{x_i}}{\sum_j e^{x_j}}$
stack_iter
Creates a larger array from an iterator of smaller arrays.
tanh
the tanh activation function: $f(x) = \frac{e^x - e^{-x}}{e^x + e^{-x}}$
tanh_derivative
the derivative of the tanh function
tril
Returns the lower triangular portion of a matrix.
triu
Returns the upper triangular portion of a matrix.
vstack
stack a 1D array into a 2D array by stacking them vertically.