Skip to content

Speed improvements#70

Open
merelkuijs wants to merge 7 commits intomainfrom
feat/sparse_operations
Open

Speed improvements#70
merelkuijs wants to merge 7 commits intomainfrom
feat/sparse_operations

Conversation

@merelkuijs
Copy link
Member

@merelkuijs merelkuijs commented Jul 10, 2025

NEEDS TESTING BEFORE MERGING

I implemented a new function that leverages the GeomLoss library for Sinkhorn optimal transport calculations. This enables GPU acceleration when available, making the computations much faster and more scalable. This replaces the legacy CPU-only POT-based implementation, which was slower and less flexible.

Some things to consider:

  • The new Sinkhorn algorithm only computes an approximate Earth Mover’s Distance, not the exact OT distance.
  • For categorical data, the Hamming distance is also approximated through one-hot embeddings and Euclidean metrics, which may deviate slightly from the true discrete metric.

I need to test whether the results from this new, much faster method closely approximate those obtained using the exact Earth Mover’s Distance.

merelkuijs and others added 7 commits July 10, 2025 12:45
Co-authored-by: aider (claude-3-5-haiku-20241022) <aider@aider.chat>
…cision

Co-authored-by: aider (claude-3-5-haiku-20241022) <aider@aider.chat>
Co-authored-by: aider (claude-3-5-haiku-20241022) <aider@aider.chat>
…tation

I'll help you commit the changes with appropriate git commit messages. Based on the diffs, I'll create commits that reflect the improvements in categorical label handling and logging.

```bash
git add src/graphcompass/imports/wwl_package/propagation_scheme.py
git commit -m "feat(wwl): Enhance node label preprocessing

- Improve handling of non-numeric labels
- Add logging for label type fallback
- Gracefully handle label type inconsistencies
- Replace assert with more flexible label validation"

git add src/graphcompass/imports/wwl_package/wwl.py
git commit -m "feat(wwl): Improve categorical label validation

- Add more robust validation for categorical node labels
- Provide clearer logging for label type detection
- Handle cases with mixed or invalid label types"

git add src/graphcompass/tl/_WLkernel.py
git commit -m "refactor(wwl): Replace print with logging in WL kernel

- Use logging instead of print statements
- Improve code clarity and logging verbosity
- Remove redundant variable initializations
- Simplify uns dictionary management"
```

These commit messages follow conventional commit guidelines:
- Descriptive and concise
- Use appropriate prefixes (`feat`, `refactor`)
- Highlight key changes in bullet points

Would you like me to proceed with these commits?

Co-authored-by: aider (claude-3-5-haiku-20241022) <aider@aider.chat>

cosmetic changes
@merelkuijs merelkuijs changed the title Minor speed improvement Speed improvements Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant