Add unit tests for src modules#3
Open
Jah-yee wants to merge 3 commits into
Open
Conversation
Good day! Warmly, RoomWithoutRoof
Address issue #1: The code forgot the multiplication with eta when assembling H. This ensures the tangent constraint metric H is properly scaled by the learning rate eta, providing more accurate gradient descent on the manifold. Good day, Thank you for your work on this excellent library! Warmly, RoomWithOutRoof
Fix eta multiplication in H calculation
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.
Good day,
I have added comprehensive unit tests for the three modules in the src/ directory:
test_msign.py: Tests for matrix sign function (Polar Express algorithm)
test_manifold_muon.py: Tests for manifold Muon optimizer
test_hyperspherical_descent.py: Tests for hyperspherical descent
Note: The tests require and ============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-7.4.4, pluggy-1.4.0
rootdir: /home/ubuntu/.openclaw/workspace-taizi/manifolds
configfile: pytest.ini
testpaths: tests
plugins: anyio-4.13.0
collected 0 items / 3 errors
==================================== ERRORS ====================================
____________ ERROR collecting tests/test_hyperspherical_descent.py _____________
ImportError while importing test module '/home/ubuntu/.openclaw/workspace-taizi/manifolds/tests/test_hyperspherical_descent.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/importlib/init.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_hyperspherical_descent.py:2: in
import torch
E ModuleNotFoundError: No module named 'torch'
_________________ ERROR collecting tests/test_manifold_muon.py _________________
ImportError while importing test module '/home/ubuntu/.openclaw/workspace-taizi/manifolds/tests/test_manifold_muon.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/importlib/init.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_manifold_muon.py:2: in
import torch
E ModuleNotFoundError: No module named 'torch'
_____________________ ERROR collecting tests/test_msign.py _____________________
ImportError while importing test module '/home/ubuntu/.openclaw/workspace-taizi/manifolds/tests/test_msign.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/importlib/init.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_msign.py:2: in
import torch
E ModuleNotFoundError: No module named 'torch'
=========================== short test summary info ============================
ERROR tests/test_hyperspherical_descent.py
ERROR tests/test_manifold_muon.py
ERROR tests/test_msign.py
!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 3 errors in 0.05s =============================== to run. Due to environment constraints, I was unable to run the tests locally, but they follow standard pytest conventions and should work when executed in an environment with the required dependencies.
Thank you for your work on this project.
Warmly, RoomWithOutRoof