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

Refactor structural reasoner #100

Merged
merged 4 commits into from
Nov 8, 2024
Merged

Conversation

LckyLke
Copy link
Collaborator

@LckyLke LckyLke commented Nov 8, 2024

Refactoring for Issue #98

@Demirrr
Copy link
Member

Demirrr commented Nov 8, 2024

Can you please add few tests ?

@alkidbaci
Copy link
Collaborator

I was hoping we could discuss this stuff about StructuralReasoner on Monday before doing any changes

@Demirrr
Copy link
Member

Demirrr commented Nov 8, 2024

Sorry, I don't think there is a need to discuss about these changes. We haven't discussed using LRUCache but this seems to be integrated which I haven't seen it

@alkidbaci alkidbaci mentioned this pull request Nov 8, 2024
self._init()

def _init(self, cache_size=128):

individuals = self._ontology.individuals_in_signature()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that we are removing the line where we get the individuals once and we are adding individual retrieval on line 606, 647, 767, 803 which will be killing the algo in large KGs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i just replaced ind_set with the individuals_in_signature() method when ever it is used.
Ig an advantage is that this is only computed if it is really need and not always on initialisation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get the correctness done first, then focus on trading of the memory with runtimes.
It is my mistake that I should have not accept the PR based on caching.

@alkidbaci
Copy link
Collaborator

We haven't discussed using LRUCache but this seems to be integrated which I haven't seen it

I have not integrated LRUCache, it has been there since the time of Simon Bin and Lukas and I'm not against removing it

@Demirrr Demirrr merged commit a9d55ce into develop Nov 8, 2024
5 checks passed
@Demirrr Demirrr deleted the refactor_structural_reasoner branch November 8, 2024 14:54
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.

3 participants