Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add thread-safe caching to similarity calculations #23

Open
anergictcell opened this issue Mar 18, 2023 · 0 comments
Open

Add thread-safe caching to similarity calculations #23

anergictcell opened this issue Mar 18, 2023 · 0 comments

Comments

@anergictcell
Copy link
Owner

Desired functionality
hpo has a struct that caches similarity calculations from term-term calculations. This caching should be safe across threads to allow multiprocessing similarity.

Constraints
With an Ontology with ~13,000 terms, the total number of possible combinations is
n! / (k! * (n - k)!)
--> 13,000! / (2! * (13,000 -2)!)
==> 84,493,500

For each combination we must store a 32bit float similarity score + a hash for the two 32bit HpoTermIds. So we could end up with a huge cache and might have to find a way to limit the overall size. We could e.g. have one Hashset that contains all comparisons that result in 1 and another one for all that result in 0.

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

No branches or pull requests

1 participant