pylissom¶
pylissom.math module¶
This module contains auxiliary math functions.
-
pylissom.math.
euclidian_distances
(x, y, mu_x, mu_y)[source]¶ This function implements the euclidean distance between two 2-dimensional vectors.
Parameters: - x – first element of the first vector
- y – second element of the first vector
- mu_x – first element of the second vector
- mu_y – second element of the second vector
Returns: Euclidean distance
-
pylissom.math.
euclidean_distance_general
(x, y)[source]¶ This function implements the euclidean distance between two n-dimensional vectors as numpy arrays.
Parameters: - x – First vector (numpy array)
- y – Second vector (numpy array)
Returns: euclidean distance
-
pylissom.math.
gaussian
(x, y, mu_x, mu_y, sigma, sigma_y=None)[source]¶ This function implements a circular gaussian function.
Parameters: - x –
- y –
- mu_x – Center
- mu_y – Center
- sigma –
- sigma_y –
Returns: Gaussian
-
pylissom.math.
normalize
(matrix, norm=1, axis=1)[source]¶ This function implements a normalization of the row or column vectors of a matrix (by default, normalizes the columns and uses norm 1).
Parameters: - matrix – input matrix
- norm – Dimension of the norm
- axis – 0 is column, 1 is row
Returns: A matrix normalized by columns or rows