nip.utils.maths#
Utilities for useful mathematical operations.
Functions
|
Zero the gradients of the parameters in a dictionary. |
|
Compute the mean of values grouped by class. |
Approximate the inverse Hessian vector product with conjugate gradient. |
|
|
Approximate the inverse Hessian vector product with the Neumann method. |
|
Approximate the inverse Hessian vector product with the Nystrom method. |
|
Compute the update for the Stable Opponent Shaping (SOS) algorithm. |
|
Calculate the dot product between two dictionaries of tensors. |
|
Calculate a scalar multiple of a dictionary of tensors. |
|
Calculate the sum of two dictionaries of tensors, element-wise. |
|
Compute the inverse Hessian-vector product using specified approximation method. |
|
Check if two shapes are broadcastable. |
|
Compute the entropy of a set of logits. |
|
Compute the logit of the OR of n events given their logits. |
|
Compute the logit OR operation for two input tensors with the log-sum-exp trick. |
|
Compute the mean total episode reward for a batch of concatenated episodes. |
|
Compute the mean of values grouped by unique keys. |
|
Generate a pseudo-random sequence of numbers using the MINSTD algorithm. |
|
Set the seed in Python, NumPy, and PyTorch. |