eazygrad.functions

Activations

relu

Apply the rectified linear unit activation elementwise.

sigmoid

Apply the sigmoid activation elementwise.

tanh

Apply the hyperbolic tangent activation elementwise.

Math

min

Return the elementwise minimum of two tensors.

exp

Compute the elementwise exponential.

log

Compute the elementwise natural logarithm.

cos

Compute the elementwise cosine.

sin

Compute the elementwise sine.

clip

Clip tensor values to a closed interval.

Special Functions

logsumexp

Compute log(sum(exp(input))) in a numerically stable way.

softmax

Compute the softmax of a tensor along a given axis.

log_softmax

Compute the logarithm of the softmax along a given axis.

Losses

mse_loss

Compute the mean squared error loss.

nll_loss

Compute the negative log-likelihood loss from log-probabilities.

bce_with_logits_loss

Compute binary cross-entropy loss from unnormalized logits.

bce_loss

Compute binary cross-entropy loss from probabilities.

cross_entropy_loss

Compute cross-entropy loss from class logits.