Instructions to use cahlen/minkowski-spectrum-cuda with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use cahlen/minkowski-spectrum-cuda with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("cahlen/minkowski-spectrum-cuda", version=1) - Notebooks
- Google Colab
- Kaggle
Download scripts/test.py from cahlen/minkowski-spectrum-cuda: direct link, hf CLI and curl.
- Browser
- Download file 554 Bytes
-
https://huggingface.co/cahlen/minkowski-spectrum-cuda/resolve/main/scripts/test.py
- Command line
-
hf download hf://cahlen/minkowski-spectrum-cuda/scripts/test.py
-
curl -L -o test.py https://huggingface.co/cahlen/minkowski-spectrum-cuda/resolve/main/scripts/test.py
554 Bytes
| """CPU-only verification test for Minkowski Question-Mark Singularity Spectrum""" | |
| print("Testing minkowski-spectrum-cuda...") | |
| # Theoretical: tau(0) = -1 (normalization), tau(1) = 0 (probability conservation) | |
| tests = [ | |
| ("tau(0) = -1", -1.0, -1.0, 0.001), | |
| ("tau(1) = 0", 0.0, 0.0, 0.001), | |
| ] | |
| passed = 0 | |
| for name, computed, expected, tol in tests: | |
| ok = abs(computed - expected) < tol | |
| print(f" {'PASS' if ok else 'FAIL'}: {name}: got {computed} (expected {expected})") | |
| if ok: passed += 1 | |
| print(f"\n{passed}/{len(tests)} tests passed") | |