twodlearn.core.array module

class twodlearn.core.array.Np2dMesh(x1, x2)[source]

Bases: object

2d mesh created with np.meshgrid

property asarray[source]
property asmesh[source]
vect2mesh(array)[source]
twodlearn.core.array.add_diagonal_shift(matrix, shift)[source]

Returns matrix + shift*I

twodlearn.core.array.expand_dims_left(x, ndims)[source]

add ndim dimensions on the left

twodlearn.core.array.expand_dims_left_like(x, y)[source]

add dimensions on the left to match the number of dimensions in y

twodlearn.core.array.is_scalar(value)[source]
twodlearn.core.array.is_square_matrix(array)[source]

Returns if array is a square matrix

twodlearn.core.array.mesh2array(mesh)[source]

convert a 2d mesh created with np.meshgrid to an matrix representation

twodlearn.core.array.np_dtype(value)[source]
twodlearn.core.array.reduce_sum_rightmost(x, ndims)[source]

Return tensor with right-most ndims summed

twodlearn.core.array.transpose_rightmost(x)[source]

transpose the rightmost dimensions