Revise tests and numerous fixes#149
Merged
Merged
Conversation
… below. - Improve lab_extras.take_along_axis - SpecialOrthogonal/SpecialUnitary fixes for non-numpy backends - Add str for all spaces - Hypersphere.num_eigenfunctions refactor to avoid code duplication - Add num_eigenfunctions caching in WeylAdditionTheorem, similar to how it is done in SphericalHarmonics
cf709a9 to
623fb63
Compare
…Orthogonal, SpecialUnitary spaces buy introducing the new tests/spaces/test_eigenfunctions_basics.py and more: - fix a bug in SpecialUnitary under TensorFlow - add Euclidean Matérn -1/2 -3/2 -5/2 and RBF kernels to geometric_kernels/utils/special_functions.py
…the requested number of eigenpairs exceeds the size of the adjacency matrix. Also, added support of sparray (in addition to spmatrix) in lab_extras/numpy/sparse_extras.py.
…s_basics.py, add tests/spaces/test_eigenvalues.py and tests/spaces/test_basics.py
…e maximal number of eigenpairs for a graph
b84b03f to
3b6799e
Compare
3708353 to
9281d5e
Compare
…ompact's __init__ to avoid circular imports
… because of issue #152
…function_with_backend with custom compare_to_result more verbose
…ow part of test_feature_map_kernel and test_matern_karhunenloeve_kernel
… function that returns the list of all spaces to tests/helper.py. Make tests/spaces/test_basics.py more thorough.
…ax and tensorflow by removing item assignments and adding explicit casts
…/test_samplers.py
…ked in different places throughout the tests
- Implemented some alternative formulas for the heat kernel on `Hyperbolic` and `SymmetricPositiveDefiniteMatrices` for testing, along with the respective tests. - Revised and refactored the tests for `ProductDiscreteSpectrumSpace` and `ProductGeometricKernel`. - Changed `params_to_params_list` function to take the number of factors as an explicit parameter. `ProductGeometricKernel` can now take 1-d length scale and nu parameters. - Rewritten `random` for `Hyperbolic` and `SymmetricPositiveDefiniteMatrices` to actually use the provided random key. - Moved the implementation of `Hyperbolic.distance` and `Hyperbolic.inner_product` to utils.manifold_utils (the functions `hyperbolic_distance` and `minkowski_inner_product`). - Moved MaternKarhunenLoeveKernel import inside __init__ in feature_maps/random_phase.py to avoid circular imports. - Added an informative error message in case `check_function_with_backend` fails because of shape mismatch. - Added a workaround for a bug in lab (wesselb/lab#21) - it was only an issue for one of the tests and couldn't have affected the main code. - Moved all kernel formulas from `utils.special_functions` to a new subpackage `utils.kernel_formulas`. - Updated bib entries for the "Stationary Kernels and Gaussian Processes on Lie Groups and their Homogeneous Spaces" papers which have been recently accepted by JMLR.
…/test_spd.py to speed up tests and make them more robust in the light of numerical instabilities
412f44b to
edf9073
Compare
…ctrumSpace` that were arising under torch and tensorflow when you mix complex and real data types. More details below.
edf9073 to
c050d53
Compare
Collaborator
stoprightthere
left a comment
There was a problem hiding this comment.
I've reviewed roughly 2/3 of the changes. Good job! Check some of my comments out.
Collaborator
stoprightthere
left a comment
There was a problem hiding this comment.
Thanks! Please take a look at the remaining comments.
| X, | ||
| X2, | ||
| compare_to_result=lambda res, f_out: B.shape(f_out) == res, | ||
| ) |
Collaborator
There was a problem hiding this comment.
This can't be an issue because you can recursively cast nested dicts/lists:
def apply_recursive(data: Any, func: Callable[[Any], Any]) -> Any:
if isinstance(data, dict):
return {key: apply_recursive(value, func) for key, value in data.items()}
elif isinstance(data, list):
return [apply_recursive(element, func) for element in data]
else:
return func(data)But a def will do!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.