geomstats package#
Subpackages#
- geomstats.datasets package
- Submodules
- geomstats.datasets.prepare_emg_data module
TimeSeriesCovariance
TimeSeriesCovariance.label_map
TimeSeriesCovariance.data_dict
TimeSeriesCovariance.n_steps
TimeSeriesCovariance.n_timeseries
TimeSeriesCovariance.batches
TimeSeriesCovariance.margin
TimeSeriesCovariance.covs
TimeSeriesCovariance.labels
TimeSeriesCovariance.covec
TimeSeriesCovariance.diags
TimeSeriesCovariance.transform()
- geomstats.datasets.prepare_graph_data module
- geomstats.datasets.utils module
- Module contents
- geomstats.distributions package
- geomstats.geometry package
- Subpackages
- Submodules
- geomstats.geometry.base module
- geomstats.geometry.complex_manifold module
- geomstats.geometry.complex_matrices module
ComplexMatrices
ComplexMatrices.belongs()
ComplexMatrices.congruent()
ComplexMatrices.default_metric()
ComplexMatrices.frobenius_product()
ComplexMatrices.is_hermitian()
ComplexMatrices.is_hpd()
ComplexMatrices.is_skew_hermitian()
ComplexMatrices.random_point()
ComplexMatrices.to_hermitian()
ComplexMatrices.to_skew_hermitian()
ComplexMatrices.transconjugate()
ComplexMatricesMetric
- geomstats.geometry.complex_poincare_disk module
- geomstats.geometry.complex_riemannian_metric module
- geomstats.geometry.connection module
Connection
Connection.christoffels()
Connection.curvature()
Connection.curvature_derivative()
Connection.directional_curvature()
Connection.directional_curvature_derivative()
Connection.exp()
Connection.geodesic()
Connection.geodesic_equation()
Connection.injectivity_radius()
Connection.ladder_parallel_transport()
Connection.log()
Connection.parallel_transport()
Connection.ricci_tensor()
Connection.riemann_tensor()
- geomstats.geometry.diffeo module
- geomstats.geometry.discrete_curves module
DiscreteCurvesStartingAtOrigin
DiscreteCurvesStartingAtOrigin.ambient_manifold
DiscreteCurvesStartingAtOrigin.default_metric()
DiscreteCurvesStartingAtOrigin.insert_origin()
DiscreteCurvesStartingAtOrigin.k_sampling_points
DiscreteCurvesStartingAtOrigin.new()
DiscreteCurvesStartingAtOrigin.projection()
DiscreteCurvesStartingAtOrigin.random_point()
DynamicProgrammingAligner
ElasticTranslationMetric
FTransform
IterativeHorizontalGeodesicAligner
L2CurvesMetric
SRVTransform
SRVTranslationMetric
SRVTranslationReparametrizationBundle
SRVTranslationReparametrizationQuotientMetric
centered_difference()
forward_difference()
insert_zeros()
second_centered_difference()
- geomstats.geometry.discrete_surfaces module
DiscreteSurfaces
DiscreteSurfaces.belongs()
DiscreteSurfaces.default_metric()
DiscreteSurfaces.face_areas()
DiscreteSurfaces.is_tangent()
DiscreteSurfaces.laplacian()
DiscreteSurfaces.normals()
DiscreteSurfaces.projection()
DiscreteSurfaces.random_point()
DiscreteSurfaces.surface_metric_matrices()
DiscreteSurfaces.surface_one_forms()
DiscreteSurfaces.to_tangent()
DiscreteSurfaces.vertex_areas()
ElasticMetric
- geomstats.geometry.euclidean module
- geomstats.geometry.fiber_bundle module
FiberBundle
FiberBundle.align()
FiberBundle.horizontal_lift()
FiberBundle.horizontal_projection()
FiberBundle.integrability_tensor()
FiberBundle.integrability_tensor_derivative()
FiberBundle.is_horizontal()
FiberBundle.is_vertical()
FiberBundle.lift()
FiberBundle.riemannian_submersion()
FiberBundle.tangent_riemannian_submersion()
FiberBundle.vertical_projection()
- geomstats.geometry.full_rank_correlation_matrices module
CorrelationMatricesBundle
FullRankCorrelationAffineQuotientMetric
FullRankCorrelationMatrices
FullRankCorrelationMatrices.default_metric()
FullRankCorrelationMatrices.diag_action()
FullRankCorrelationMatrices.from_covariance()
FullRankCorrelationMatrices.projection()
FullRankCorrelationMatrices.random_point()
FullRankCorrelationMatrices.submersion()
FullRankCorrelationMatrices.tangent_submersion()
FullRankCorrelationMatrices.to_tangent()
PolyHyperbolicCholeskyMetric
- geomstats.geometry.full_rank_matrices module
- geomstats.geometry.functions module
- geomstats.geometry.general_linear module
- geomstats.geometry.grassmannian module
- geomstats.geometry.heisenberg module
HeisenbergVectors
HeisenbergVectors.compose()
HeisenbergVectors.exp_from_identity()
HeisenbergVectors.identity
HeisenbergVectors.inverse()
HeisenbergVectors.jacobian_translation()
HeisenbergVectors.lie_bracket()
HeisenbergVectors.log_from_identity()
HeisenbergVectors.upper_triangular_matrix_from_vector()
HeisenbergVectors.vector_from_upper_triangular_matrix()
- geomstats.geometry.hermitian module
- geomstats.geometry.hermitian_matrices module
- geomstats.geometry.hpd_matrices module
- geomstats.geometry.hyperbolic module
- geomstats.geometry.hyperboloid module
- geomstats.geometry.hypersphere module
Hypersphere
HypersphereMetric
HypersphereMetric.christoffels()
HypersphereMetric.curvature()
HypersphereMetric.curvature_derivative()
HypersphereMetric.dist()
HypersphereMetric.exp()
HypersphereMetric.injectivity_radius()
HypersphereMetric.inner_product()
HypersphereMetric.log()
HypersphereMetric.metric_matrix()
HypersphereMetric.norm_factor_gradient()
HypersphereMetric.normalization_factor()
HypersphereMetric.parallel_transport()
HypersphereMetric.squared_dist()
HypersphereMetric.squared_norm()
- geomstats.geometry.invariant_metric module
- geomstats.geometry.landmarks module
- geomstats.geometry.lie_algebra module
- geomstats.geometry.lie_group module
LieGroup
LieGroup.lie_algebra
LieGroup.compose()
LieGroup.default_metric()
LieGroup.exp()
LieGroup.exp_from_identity()
LieGroup.exp_not_from_identity()
LieGroup.identity
LieGroup.inverse()
LieGroup.is_tangent()
LieGroup.jacobian_translation()
LieGroup.lie_bracket()
LieGroup.log()
LieGroup.log_from_identity()
LieGroup.log_not_from_identity()
LieGroup.tangent_translation_map()
LieGroup.to_tangent()
MatrixLieGroup
- geomstats.geometry.lower_triangular_matrices module
- geomstats.geometry.manifold module
- geomstats.geometry.matrices module
Matrices
Matrices.align_matrices()
Matrices.bracket()
Matrices.congruent()
Matrices.default_metric()
Matrices.diagonal()
Matrices.equal()
Matrices.flatten()
Matrices.frobenius_product()
Matrices.is_diagonal()
Matrices.is_lower_triangular()
Matrices.is_pd()
Matrices.is_skew_symmetric()
Matrices.is_spd()
Matrices.is_square()
Matrices.is_strictly_lower_triangular()
Matrices.is_strictly_upper_triangular()
Matrices.is_symmetric()
Matrices.is_upper_triangular()
Matrices.mul()
Matrices.random_point()
Matrices.reshape()
Matrices.to_diagonal()
Matrices.to_lower_triangular()
Matrices.to_lower_triangular_diagonal_scaled()
Matrices.to_skew_symmetric()
Matrices.to_strictly_lower_triangular()
Matrices.to_strictly_upper_triangular()
Matrices.to_symmetric()
Matrices.to_upper_triangular()
Matrices.trace_product()
Matrices.transpose()
MatricesMetric
- geomstats.geometry.minkowski module
- geomstats.geometry.nfold_manifold module
- geomstats.geometry.open_hemisphere module
- geomstats.geometry.poincare_ball module
PoincareBall
PoincareBallMetric
PoincareBallMetric.dist()
PoincareBallMetric.exp()
PoincareBallMetric.injectivity_radius()
PoincareBallMetric.log()
PoincareBallMetric.metric_matrix()
PoincareBallMetric.mobius_add()
PoincareBallMetric.norm_factor_gradient()
PoincareBallMetric.normalization_factor()
PoincareBallMetric.retraction()
PoincareBallMetric.squared_dist()
- geomstats.geometry.poincare_half_space module
- geomstats.geometry.poincare_polydisk module
- geomstats.geometry.positive_lower_triangular_matrices module
- geomstats.geometry.positive_reals module
- geomstats.geometry.pre_shape module
KendallShapeMetric
PreShapeMetric
PreShapeSpace
PreShapeSpaceBundle
PreShapeSpaceBundle.align()
PreShapeSpaceBundle.integrability_tensor()
PreShapeSpaceBundle.integrability_tensor_derivative()
PreShapeSpaceBundle.integrability_tensor_derivative_parallel()
PreShapeSpaceBundle.is_horizontal()
PreShapeSpaceBundle.iterated_integrability_tensor_derivative_parallel()
PreShapeSpaceBundle.vertical_projection()
- geomstats.geometry.product_hpd_and_siegel_disks module
- geomstats.geometry.product_manifold module
ProductManifold
ProductRiemannianMetric
ProductRiemannianMetric.default_point_type
ProductRiemannianMetric.dist()
ProductRiemannianMetric.exp()
ProductRiemannianMetric.geodesic()
ProductRiemannianMetric.inner_product()
ProductRiemannianMetric.log()
ProductRiemannianMetric.metric_matrix()
ProductRiemannianMetric.shape
ProductRiemannianMetric.squared_norm()
- geomstats.geometry.product_positive_reals_and_poincare_disks module
- geomstats.geometry.pullback_metric module
PullbackDiffeoMetric
PullbackDiffeoMetric.curvature()
PullbackDiffeoMetric.dist()
PullbackDiffeoMetric.exp()
PullbackDiffeoMetric.geodesic()
PullbackDiffeoMetric.inner_product()
PullbackDiffeoMetric.log()
PullbackDiffeoMetric.metric_matrix()
PullbackDiffeoMetric.norm()
PullbackDiffeoMetric.parallel_transport()
PullbackDiffeoMetric.squared_dist()
PullbackDiffeoMetric.squared_norm()
PullbackMetric
- geomstats.geometry.quotient_metric module
- geomstats.geometry.rank_k_psd_matrices module
- geomstats.geometry.riemannian_metric module
RiemannianMetric
RiemannianMetric.christoffels()
RiemannianMetric.closest_neighbor_index()
RiemannianMetric.cometric_matrix()
RiemannianMetric.covariant_riemann_tensor()
RiemannianMetric.diameter()
RiemannianMetric.dist()
RiemannianMetric.dist_broadcast()
RiemannianMetric.dist_pairwise()
RiemannianMetric.hamiltonian()
RiemannianMetric.inner_coproduct()
RiemannianMetric.inner_product()
RiemannianMetric.inner_product_derivative_matrix()
RiemannianMetric.metric_matrix()
RiemannianMetric.norm()
RiemannianMetric.normal_basis()
RiemannianMetric.normalize()
RiemannianMetric.random_unit_tangent_vec()
RiemannianMetric.scalar_curvature()
RiemannianMetric.sectional_curvature()
RiemannianMetric.squared_dist()
RiemannianMetric.squared_norm()
- geomstats.geometry.sasaki_metric module
- geomstats.geometry.scalar_product_metric module
- geomstats.geometry.siegel module
Siegel
SiegelMetric
SiegelMetric.exp()
SiegelMetric.exp_at_zero()
SiegelMetric.inner_product()
SiegelMetric.isometry()
SiegelMetric.log()
SiegelMetric.log_at_zero()
SiegelMetric.sectional_curvature()
SiegelMetric.sectional_curvature_at_zero()
SiegelMetric.squared_dist()
SiegelMetric.tangent_vec_from_base_point_to_zero()
SiegelMetric.tangent_vec_from_zero_to_base_point()
- geomstats.geometry.skew_symmetric_matrices module
- geomstats.geometry.spd_matrices module
- geomstats.geometry.special_euclidean module
SpecialEuclidean
SpecialEuclideanMatricesCanonicalLeftMetric
SpecialEuclideanMatricesCanonicalLeftMetric.exp()
SpecialEuclideanMatricesCanonicalLeftMetric.geodesic()
SpecialEuclideanMatricesCanonicalLeftMetric.injectivity_radius()
SpecialEuclideanMatricesCanonicalLeftMetric.inner_product()
SpecialEuclideanMatricesCanonicalLeftMetric.log()
SpecialEuclideanMatricesCanonicalLeftMetric.parallel_transport()
SpecialEuclideanMatricesCanonicalLeftMetric.squared_dist()
SpecialEuclideanMatricesLieAlgebra
homogeneous_representation()
- geomstats.geometry.special_orthogonal module
- geomstats.geometry.stiefel module
- geomstats.geometry.sub_riemannian_metric module
- geomstats.geometry.symmetric_matrices module
- Module contents
- geomstats.information_geometry package
- Submodules
- geomstats.information_geometry.base module
- geomstats.information_geometry.beta module
- geomstats.information_geometry.binomial module
- geomstats.information_geometry.categorical module
- geomstats.information_geometry.dirichlet module
- geomstats.information_geometry.exponential module
- geomstats.information_geometry.fisher_rao_metric module
- geomstats.information_geometry.gamma module
GammaDistributions
GammaDistributions.belongs()
GammaDistributions.default_metric()
GammaDistributions.maximum_likelihood_fit()
GammaDistributions.natural_to_standard()
GammaDistributions.point_to_pdf()
GammaDistributions.projection()
GammaDistributions.random_point()
GammaDistributions.sample()
GammaDistributions.standard_to_natural()
GammaDistributions.tangent_natural_to_standard()
GammaDistributions.tangent_standard_to_natural()
GammaDistributionsRandomVariable
GammaMetric
- geomstats.information_geometry.geometric module
- geomstats.information_geometry.multinomial module
MultinomialDistributions
MultinomialDistributions.dim
MultinomialDistributions.embedding_manifold
MultinomialDistributions.default_metric()
MultinomialDistributions.point_to_pdf()
MultinomialDistributions.projection()
MultinomialDistributions.random_point()
MultinomialDistributions.sample()
MultinomialDistributions.submersion()
MultinomialDistributions.tangent_submersion()
MultinomialDistributions.to_tangent()
MultinomialMetric
MultinomialMetric.exp()
MultinomialMetric.geodesic()
MultinomialMetric.log()
MultinomialMetric.metric_matrix()
MultinomialMetric.sectional_curvature()
MultinomialMetric.simplex_to_sphere()
MultinomialMetric.sphere_to_simplex()
MultinomialMetric.tangent_simplex_to_sphere()
MultinomialMetric.tangent_sphere_to_simplex()
MultinomialRandomVariable
- geomstats.information_geometry.normal module
CenteredNormalDistributions
CenteredNormalMetric
DiagonalNormalDistributions
DiagonalNormalDistributionsRandomVariable
DiagonalNormalMetric
GeneralNormalDistributions
MultivariateNormalDistributionsRandomVariable
NormalDistributions
SharedMeanNormalDistributionsRandomVariable
UnivariateNormalDistributions
UnivariateNormalDistributionsRandomVariable
UnivariateNormalMetric
UnivariateNormalToPoincareHalfSpaceDiffeo
- geomstats.information_geometry.poisson module
- Module contents
- geomstats.learning package
- Submodules
- geomstats.learning.aac module
- geomstats.learning.agglomerative_hierarchical_clustering module
- geomstats.learning.expectation_maximization module
- geomstats.learning.exponential_barycenter module
- geomstats.learning.frechet_mean module
- geomstats.learning.geodesic_regression module
- geomstats.learning.geometric_median module
- geomstats.learning.incremental_frechet_mean module
- geomstats.learning.kalman_filter module
KalmanFilter
Localization
Localization.adjoint_map()
Localization.get_measurement_noise_cov()
Localization.innovation()
Localization.noise_jacobian()
Localization.observation_jacobian()
Localization.observation_model()
Localization.preprocess_input()
Localization.propagate()
Localization.propagation_jacobian()
Localization.regularize_angle()
Localization.rotation_matrix()
LocalizationLinear
- geomstats.learning.kernel_density_estimation_classifier module
- geomstats.learning.kmeans module
- geomstats.learning.kmedoids module
- geomstats.learning.knn module
- geomstats.learning.mdm module
RiemannianMinimumDistanceToMean
RiemannianMinimumDistanceToMean.classes_
RiemannianMinimumDistanceToMean.mean_estimates_
RiemannianMinimumDistanceToMean.fit()
RiemannianMinimumDistanceToMean.n_classes_
RiemannianMinimumDistanceToMean.predict()
RiemannianMinimumDistanceToMean.predict_proba()
RiemannianMinimumDistanceToMean.set_fit_request()
RiemannianMinimumDistanceToMean.set_score_request()
RiemannianMinimumDistanceToMean.transform()
- geomstats.learning.online_kmeans module
- geomstats.learning.pca module
- geomstats.learning.preprocessing module
- geomstats.learning.radial_kernel_functions module
biweight_radial_kernel()
bump_radial_kernel()
cosine_radial_kernel()
gaussian_radial_kernel()
inverse_multiquadric_radial_kernel()
inverse_quadratic_radial_kernel()
laplacian_radial_kernel()
logistic_radial_kernel()
parabolic_radial_kernel()
sigmoid_radial_kernel()
triangular_radial_kernel()
tricube_radial_kernel()
triweight_radial_kernel()
uniform_radial_kernel()
- geomstats.learning.riemannian_mean_shift module
- geomstats.learning.wrapped_gaussian_process module
- Module contents
- geomstats.numerics package
- geomstats.test package
- Submodules
- geomstats.test.conf module
- geomstats.test.data module
TestData
TestData.N_RANDOM_POINTS
TestData.N_SHAPE_POINTS
TestData.N_TIME_POINTS
TestData.N_VEC_REPS
TestData.fail_for_autodiff_exceptions
TestData.fail_for_not_implemented_errors
TestData.generate_random_data()
TestData.generate_random_data_with_time()
TestData.generate_shape_data()
TestData.generate_tests()
TestData.generate_vec_data()
TestData.generate_vec_data_with_time()
TestData.skip_all
TestData.skip_vec
TestData.skips
TestData.tolerances
TestData.trials
TestData.xfails
- geomstats.test.parametrizers module
- geomstats.test.random module
EmbeddedSpaceRandomDataGenerator
GammaRandomDataGenerator
HeisenbergVectorsRandomDataGenerator
HypersphereIntrinsicRandomDataGenerator
KendalShapeRandomDataGenerator
LieGroupVectorRandomDataGenerator
NFoldManifoldRandomDataGenerator
RandomDataGenerator
RankKPSDMatricesRandomDataGenerator
ShapeBundleRandomDataGenerator
VectorSpaceRandomDataGenerator
get_random_quaternion()
get_random_times()
- geomstats.test.test_case module
- geomstats.test.utils module
- geomstats.test.vectorization module
- Module contents
- geomstats.test_cases package
- Subpackages
- geomstats.test_cases.backend package
- geomstats.test_cases.datasets package
- geomstats.test_cases.distributions package
- geomstats.test_cases.geometry package
- Subpackages
- Submodules
- geomstats.test_cases.geometry.base module
- geomstats.test_cases.geometry.complex_manifold module
- geomstats.test_cases.geometry.complex_matrices module
- geomstats.test_cases.geometry.complex_riemannian_metric module
- geomstats.test_cases.geometry.connection module
- geomstats.test_cases.geometry.diffeo module
- geomstats.test_cases.geometry.discrete_curves module
- geomstats.test_cases.geometry.discrete_surfaces module
- geomstats.test_cases.geometry.euclidean module
- geomstats.test_cases.geometry.fiber_bundle module
- geomstats.test_cases.geometry.full_rank_correlation_matrices module
- geomstats.test_cases.geometry.general_linear module
- geomstats.test_cases.geometry.heisenberg module
- geomstats.test_cases.geometry.hermitian module
- geomstats.test_cases.geometry.hyperbolic module
- geomstats.test_cases.geometry.hypersphere module
- geomstats.test_cases.geometry.invariant_metric module
- geomstats.test_cases.geometry.lie_algebra module
- geomstats.test_cases.geometry.lie_group module
- geomstats.test_cases.geometry.manifold module
- geomstats.test_cases.geometry.matrices module
- geomstats.test_cases.geometry.mixins module
- geomstats.test_cases.geometry.nfold_manifold module
- geomstats.test_cases.geometry.poincare_ball module
- geomstats.test_cases.geometry.poincare_half_space module
- geomstats.test_cases.geometry.positive_lower_triangular_matrices module
- geomstats.test_cases.geometry.pre_shape module
- geomstats.test_cases.geometry.product_manifold module
- geomstats.test_cases.geometry.pullback_metric module
- geomstats.test_cases.geometry.quotient_metric module
- geomstats.test_cases.geometry.riemannian_metric module
- geomstats.test_cases.geometry.sasaki_metric module
- geomstats.test_cases.geometry.scalar_product_metric module
- geomstats.test_cases.geometry.siegel module
- geomstats.test_cases.geometry.skew_symmetric_matrices module
- geomstats.test_cases.geometry.spd_matrices module
- geomstats.test_cases.geometry.special_euclidean module
- geomstats.test_cases.geometry.special_orthogonal module
- geomstats.test_cases.geometry.stiefel module
- geomstats.test_cases.geometry.sub_riemannian_metric module
- Module contents
- geomstats.test_cases.information_geometry package
- Submodules
- geomstats.test_cases.information_geometry.base module
- geomstats.test_cases.information_geometry.beta module
- geomstats.test_cases.information_geometry.binomial module
- geomstats.test_cases.information_geometry.dirichlet module
- geomstats.test_cases.information_geometry.exponential module
- geomstats.test_cases.information_geometry.gamma module
- geomstats.test_cases.information_geometry.geometric module
- geomstats.test_cases.information_geometry.multinomial module
- geomstats.test_cases.information_geometry.normal module
- geomstats.test_cases.information_geometry.poisson module
- Module contents
- geomstats.test_cases.learning package
- Submodules
- geomstats.test_cases.learning.agglomerative_hierarchical_clustering module
- geomstats.test_cases.learning.expectation_maximization module
- geomstats.test_cases.learning.exponential_barycenter module
- geomstats.test_cases.learning.frechet_mean module
- geomstats.test_cases.learning.geodesic_regression module
- geomstats.test_cases.learning.incremental_frechet_mean module
- geomstats.test_cases.learning.kalman_filter module
- geomstats.test_cases.learning.kernel_density_estimation_classifier module
- geomstats.test_cases.learning.kmeans module
- geomstats.test_cases.learning.knn module
- geomstats.test_cases.learning.mdm module
- geomstats.test_cases.learning.pca module
- geomstats.test_cases.learning.preprocessing module
- geomstats.test_cases.learning.radial_kernel_functions module
- geomstats.test_cases.learning.wrapped_gaussian_process module
- Module contents
- geomstats.test_cases.numerics package
- Submodules
- geomstats.test_cases.algebra_utils module
- Module contents
- Subpackages
- geomstats.visualization package
- Submodules
- geomstats.visualization.hyperbolic module
- geomstats.visualization.hypersphere module
- geomstats.visualization.poincare_polydisk module
- geomstats.visualization.pre_shape module
KendallDisk
KendallDisk.points
KendallDisk.coords_type
KendallDisk.pole
KendallDisk.centre
KendallDisk.ua
KendallDisk.ub
KendallDisk.na
KendallDisk.add_points()
KendallDisk.clear_points()
KendallDisk.convert_to_planar_coordinates()
KendallDisk.convert_to_polar_coordinates()
KendallDisk.draw()
KendallDisk.draw_curve()
KendallDisk.draw_points()
KendallDisk.draw_triangle()
KendallDisk.draw_vector()
KendallDisk.set_ax()
KendallSphere
KendallSphere.points
KendallSphere.coords_type
KendallSphere.pole
KendallSphere.ua
KendallSphere.ub
KendallSphere.na
KendallSphere.add_points()
KendallSphere.clear_points()
KendallSphere.convert_to_polar_coordinates()
KendallSphere.convert_to_spherical_coordinates()
KendallSphere.draw()
KendallSphere.draw_curve()
KendallSphere.draw_points()
KendallSphere.draw_triangle()
KendallSphere.draw_vector()
KendallSphere.rotation()
KendallSphere.set_ax()
KendallSphere.set_view()
- geomstats.visualization.spd_matrices module
- geomstats.visualization.special_euclidean module
- geomstats.visualization.special_orthogonal module
- Module contents
Submodules#
geomstats.algebra_utils module#
Utility module of reusable algebra routines.
- geomstats.algebra_utils.flip_determinant(matrix, det)[source]#
Change sign of the determinant if it is negative.
For a batch of matrices, multiply the matrices which have negative determinant by a diagonal matrix :math:`diag(1,…,1,-1) from the right. This changes the sign of the last column of the matrix.
- Parameters:
matrix (array-like, shape=[…,n ,m]) – Matrix to transform.
det (array-like, shape=[…]) – Determinant of matrix, or any other scalar to use as threshold to determine whether to change the sign of the last column of matrix.
- Returns:
matrix_flipped (array-like, shape=[…, n, m]) – Matrix with the sign of last column changed if det < 0.
- geomstats.algebra_utils.from_vector_to_diagonal_matrix(vector, num_diag=0)[source]#
Create diagonal matrices from rows of a matrix.
- Parameters:
vector (array-like, shape=[m, n])
num_diag (int) – number of diagonal in result matrix. If 0, the result matrix is a diagonal matrix; if positive, the result matrix has an upper-right non-zero diagonal; if negative, the result matrix has a lower-left non-zero diagonal. Optional, Default: 0.
- Returns:
diagonals (array-like, shape=[m, n, n]) – 3-dimensional array where the i-th n-by-n array diagonals[i, :, :] is a diagonal matrix containing the i-th row of vector.
- geomstats.algebra_utils.rotate_points(points, end_point)[source]#
Apply to points the rotation from north_pole to end_point.
A QR decomposition is used to find the rotation that maps the north pole (1, 0,…,0) to the end_point, then this rotation is applied to the input points.
- Parameters:
points (array-like, shape=[…, n]) – Points to rotate.
end_point (array-like, shape=[n, ]) – Point to parametrise the rotation.
- Returns:
rotated_points (array-like, shape=[…, n]) – Points after the rotation.
- geomstats.algebra_utils.taylor_exp_even_func(point, taylor_function, order=5, tol=1e-06)[source]#
Taylor Approximation of an even function around zero.
- Parameters:
point (array-like) – Argument of the function to approximate.
taylor_function (dict with following keys) –
- functioncallable
Even function to approximate around zero.
- coefficientslist
Taylor coefficients of even order at zero.
order (int) – Order of the Taylor approximation. Optional, Default: 5.
tol (float) – Threshold to use the approximation instead of the function’s value. Where abs(point) <= tol, the approximation is returned.
- Returns:
function_value (array-like) – Value of the function at point.
geomstats.errors module#
Checks and associated errors.
- exception geomstats.errors.ShapeError[source]#
Bases:
ValueError
Raised when there is an incompatibility between shapes.
- geomstats.errors.check_belongs(point, manifold, **kwargs)[source]#
Raise an error if point does not belong to the input manifold.
- Parameters:
point (array-like) – Point to be tested.
manifold (Manifold) – Manifold to which the point should belong.
manifold_name (string) – Name of the manifold for the error message.
- geomstats.errors.check_integer(n, n_name)[source]#
Raise an error if n is not a > 0 integer.
- Parameters:
n (unspecified) – Parameter to be tested.
n_name (string) – Name of the parameter.
- geomstats.errors.check_parameter_accepted_values(param, param_name, accepted_values)[source]#
Raise an error if parameter does not belong to a set of values.
- Parameters:
param (unspecified) – Parameter to be tested.
param_name (string) – Name of the parameter.
accepted_values (list) – Accepted values that the parameter can take.
- geomstats.errors.check_point_shape(point, manifold, suppress_error=False)[source]#
Check if the shape of point does not match the shape of a manifold or metric.
If the final elements of the shape of point do not match the shape of manifold (which may be any object with a shape attribute, such as a Riemannian metric) then point cannot be an array of points on the manifold (or similar) and a ValueError is raised. The error can be suppressed by setting suppress_error to True.
- Parameters:
point (array-like) – The point to check the shape of.
manifold ({Manifold, RiemannianMetric}) – The object to check the point against
suppress_error (bool) – Whether to suppress the ShapeError if the shapes do not match. Optional, default is False.
- Returns:
shapes_match (bool) – Whether the shape of the point matches the shape of the manifold or metric.
- Raises:
ValueError – If the final dimensions of point are not equal to the final dimensions of manifold.
geomstats.exceptions module#
Geomstats custom exceptions.
geomstats.integrator module#
Integrator functions used when no closed forms are available.
Lead author: Nicolas Guigui.
These are designed for first order ODE written of a variable x and a time variable t:
where \(x\) is called the state variable. It may represent many variables by stacking arrays, e.g. position and velocity in a geodesic equation.
- geomstats.integrator.euler_step(force, state, time, dt)[source]#
Compute one step of the euler approximation.
- Parameters:
force (callable) – Vector field that is being integrated.
state (array-like, shape=[2, dim]) – State at time t, corresponds to position and velocity variables at time t.
time (float) – Time variable.
dt (float) – Time-step in the integration.
- Returns:
point_new (array-like, shape=[…, {dim, [n, n]}]) – First variable at time t + dt.
vector_new (array-like, shape=[…, {dim, [n, n]}]) – Second variable at time t + dt.
- geomstats.integrator.integrate(function, initial_state, end_time=1.0, n_steps=10, step='euler')[source]#
Compute the flow under the vector field using symplectic euler.
Integration function to compute flows of vector fields on a regular grid between 0 and a finite time from an initial state.
- Parameters:
function (callable) – Vector field to integrate.
initial_state (tuple of arrays) – Initial position and speed.
end_time (float) – Final integration time. Optional, default : 1.
n_steps (int) – Number of integration steps to use. Optional, default : 10.
step (str, {‘euler’, ‘rk4’, ‘group_rk2’, ‘group_rk4’}) – Numerical scheme to use for elementary integration steps. Optional, default : ‘euler’.
- Returns:
final_state (tuple) – sequences of solutions every end_time / n_steps. The shape of each element of the sequence is the same as the vectors passed in initial_state.
- geomstats.integrator.leapfrog_step(force, state, time, dt)[source]#
Compute one step of the leapfrog approximation.
- Parameters:
state (array-like, shape=[2, dim]) – State at time t, corresponds to position and velocity variables at time t.
force (callable) – Vector field that is being integrated.
time (float) – Time variable.
dt (float) – Time-step in the integration.
- Returns:
point_new (array-like, shape=[…, {dim, [n, n]}]) – First variable at time t + dt.
vector_new (array-like, shape=[…, {dim, [n, n]}]) – Second variable at time t + dt.
- geomstats.integrator.rk2_step(force, state, time, dt)[source]#
Compute one step of the rk2 approximation.
- Parameters:
force (callable) – Vector field that is being integrated.
state (array-like, shape=[2, dim]) – State at time t, corresponds to position and velocity variables at time t.
time (float) – Time variable.
dt (float) – Time-step in the integration.
- Returns:
point_new (array-like, shape=[…, {dim, [n, n]}]) – First variable at time t + dt.
vector_new (array-like, shape=[…, {dim, [n, n]}]) – Second variable at time t + dt.
See also
https
//en.wikipedia.org/wiki/Runge–Kutta_methods
- geomstats.integrator.rk4_step(force, state, time, dt)[source]#
Compute one step of the rk4 approximation.
- Parameters:
force (callable) – Vector field that is being integrated.
state (array-like, shape=[2, dim]) – State at time t, corresponds to position and velocity variables at time t.
time (float) – Time variable.
dt (float) – Time-step in the integration.
- Returns:
point_new (array-like, shape=[…, {dim, [n, n]}]) – First variable at time t + dt.
vector_new (array-like, shape=[…, {dim, [n, n]}]) – Second variable at time t + dt.
See also
https
//en.wikipedia.org/wiki/Runge–Kutta_methods
- geomstats.integrator.symplectic_euler_step(force, state, time, dt)[source]#
Compute one step of the symplectic euler approximation.
- Parameters:
state (array-like, shape=[2, dim]) – State at time t, corresponds to position and velocity variables at time t.
force (callable) – Vector field that is being integrated.
time (float) – Time variable.
dt (float) – Time-step in the integration.
- Returns:
point_new (array-like, shape=[…, {dim, [n, n]}]) – First variable at time t + dt.
vector_new (array-like, shape=[…, {dim, [n, n]}]) – Second variable at time t + dt.
geomstats.vectorization module#
Decorator to handle vectorization.
This abstracts the backend type.
- geomstats.vectorization.adapt_result(result, initial_shapes, args_kwargs_types, is_scal)[source]#
Adapt shape of output.
This function squeezes the dim 0 or 1 of the output, depending on:
the type of the output: scalar vs else,
the initial shapes or args and kwargs provided by the user.
- Parameters:
result (unspecified) – Output of the function.
initial_shapes (list) – Shapes of args and kwargs provided by the user.
args_kwargs_types (list) – Types of args and kwargs.
is_scal (bool) – Boolean determining if the output ‘result’ is a scalar.
- Returns:
result (unspecified) – Output of the function, with adapted shape.
- geomstats.vectorization.adapt_types(args_types, kwargs_types, opt_kwargs_types, args, kwargs)[source]#
Adapt the list of input input_types.
Some functions are implemented with array-like arguments that can be either ‘vector’ or ‘matrix’ depending on the value of the ‘point_type’ argument.
This function reads the ‘point_type’ argument, and adapt the actual type of the input array-like arguments.
- Parameters:
args_types (list) – Types of args.
kwargs_types (list) – Types of kwargs.
opt_kwargs_types (list) – Types of optional kwargs.
args (tuple) – Args of a function.
kwargs (dict) – Kwargs of a function.
- Returns:
args_types (list) – Adapted types of args.
kwargs_types (list) – Adapted types of kwargs.
- geomstats.vectorization.broadcast_to_multibatch(batch_shape_a, batch_shape_b, array_a, *array_b)[source]#
Broadcast to multibatch.
Gives to both arrays batch shape batch_shape_b + batch_shape_a.
Does nothing if one of the batch shapes is empty.
- Parameters:
batch_shape_a (tuple) – Batch shape of array_a.
batch_shape_b (tuple) – Batch shape of array_b.
array_a (array)
array_b (array)
- geomstats.vectorization.check_is_batch(point_ndim, *point)[source]#
Check if inputs are batch.
- Parameters:
point_ndim (int) – Point number of array dimensions.
point (array-like) – Point belonging to the space.
- Returns:
is_batch (bool) – Returns True if point contains several points.
- geomstats.vectorization.get_batch_shape(point_ndim, *point)[source]#
Get batch shape.
- Parameters:
point_ndim (int) – Point number of array dimensions.
point (array-like or None) – Point belonging to the space.
- Returns:
batch_shape (tuple) – Returns the shape related with batch. () if only one point.
- geomstats.vectorization.get_initial_shapes(input_types, args)[source]#
Extract shapes and ndims of input args or kwargs values.
Store the shapes of the input args, or kwargs values, that are array-like, store None otherwise.
- Parameters:
input_types (list) – Point types corresponding to the args, or kwargs values.
args (tuple or dict_values) – Args, or kwargs values, of a function.
- Returns:
in_shapes (list) – Shapes of array-like input args, or kwargs values.
- geomstats.vectorization.get_n_points(point_ndim, *point)[source]#
Compute the number of points.
- Parameters:
point_ndim (int) – Point number of array dimensions.
point (array-like) – Point belonging to the space.
- Returns:
n_points (int) – Number of points.
- geomstats.vectorization.get_types(input_types, args, kwargs)[source]#
Extract the types of args, kwargs, optional kwargs and output.
- Parameters:
input_types (list) – List of inputs’ input_types, including for optional inputs.
args (tuple) – Args of a function.
kwargs (dict) – Kwargs of a function.
- Returns:
args_types (list) – Types of args.
kwargs_types (list) – Types of kwargs.
opt_kwargs_types (list) – Types of optional kwargs.
is_scal (bool) – Boolean determining if the output is a scalar.
- geomstats.vectorization.is_scalar(vect_array)[source]#
Test if a “fully-vectorized” array represents a scalar.
- Parameters:
vect_array (array-like) – Array to be tested.
- Returns:
is_scalar (bool) – Boolean determining if vect_array is a fully-vectorized scalar.
- geomstats.vectorization.repeat_out(point_ndim, out, *point, out_shape=())[source]#
Repeat out shape after finding batch shape.
- Parameters:
point_ndim (int) – Point number of array dimensions.
out (array-like) – Output to be repeated
point (array-like or None) – Point belonging to the space.
out_shape (tuple) – Indicates out shape for no batch computations.
- Returns:
out (array-like) – If no batch, then input is returned. Otherwise it is broadcasted.
- geomstats.vectorization.repeat_point(point, n_reps=2, expand=False)[source]#
Repeat point.
- Parameters:
point (array-like) – Point of a space.
n_reps (int) – Number of times the point should be repeated.
expand (bool) – Repeat even if n_reps == 1.
- Returns:
rep_point (array-like) – point repeated n_reps times.
- geomstats.vectorization.squeeze_output_dim_0(result, in_shapes, input_types)[source]#
Determine if the output needs to be squeezed on dim 0.
The dimension 0 is squeezed iff all input parameters:
contain one sample,
have the corresponding dimension 0 squeezed, i.e. if all input parameters have ndim strictly less than the ndim corresponding to their vectorized shape.
- Parameters:
in_ndims (list) – Initial ndims of input parameters, as entered by the user.
input_types (list) – Associated list of input_type of input parameters.
- Returns:
squeeze (bool) – Boolean deciding whether to squeeze dim 0 of the output.
- geomstats.vectorization.squeeze_output_dim_1(result, in_shapes, input_types, is_scal=True)[source]#
Determine if the output needs to be squeezed on dim 1.
This happens if the user represents scalars as array of shapes: [n_samples,] instead of [n_samples, 1] Dimension 1 is squeezed by default if input_type is ‘scalar’. Dimension 1 is not squeezed if the user inputs at least one scalar with a singleton in dimension 1.
- Parameters:
result (array-like) – Result output by the function, before reshaping.
in_shapes (list) – Initial shapes of input parameters, as entered by the user.
input_types (list) – Associated list of input_type of input parameters.
- Returns:
squeeze (bool) – Boolean deciding whether to squeeze dim 1 of the output.
- geomstats.vectorization.vectorize_args(input_types, args)[source]#
Vectorize input args.
Transform input array-like args into their fully-vectorized form, where “fully-vectorized” means that:
one scalar has shape [1, 1],
n scalars have shape [n, 1],
one d-D vector has shape [1, d],
n d-D vectors have shape [n, d],
etc.
- Parameters:
input_types (list) – Point types corresponding to the args.
args (tuple) – Args of a function.
- Returns:
vect_args (tuple) – Args of the function in their fully-vectorized form.
- geomstats.vectorization.vectorize_kwargs(input_types, kwargs)[source]#
Vectorize input kwargs.
Transform input array-like kwargs into their fully-vectorized form, where “fully-vectorized” means that:
one scalar has shape [1, 1],
n scalars have shape [n, 1],
one d-D vector has shape [1, d],
n d-D vectors have shape [n, d],
etc.
- Parameters:
input_types (list) – Point types corresponding to the args.
kwargs (dict) – Kwargs of a function.
- Returns:
vect_kwargs (dict) – Kwargs of the function in their fully-vectorized form.
Module contents#
Import main modules.