utils

rnntoolkit.utils.angle_between(v1: Tensor, v2: Tensor) Tensor[source]

Returns the angle in radians between vectors ‘v1’ and ‘v2’:

rnntoolkit.utils.line_attractor_score(lambda_1: float, lambda_2: float, tau: float) Tuple[float, float, float][source]

Calculate the line attractor score based on the eigenvalues (lambda_1, lambda_2) and the time constant (tau).

Args:

lambda_1 (float): First eigenvalue. lambda_2 (float): Second eigenvalue. tau (float): Time constant.

Returns:

float: Calculated line attractor score.

rnntoolkit.utils.orthogonalize(v1: Tensor, *args) Tuple[Tensor, ...][source]

Find orthgonal basis for passed in LDA objects This function will update the mode for each passed in object according to the new basis

Args:

v1 (torch.Tensor): an initial vector to begin orthgonalization args: any additional number of vectors

rnntoolkit.utils.projection(v1: Tensor, v2: Tensor) Tensor[source]

Projection of tensor v1 onto tensor v2

rnntoolkit.utils.unit_vector(vector: Tensor) Tensor[source]

Returns the unit vector of the vector.