Skip to content

Conversation

@dantuzi
Copy link
Contributor

@dantuzi dantuzi commented Dec 30, 2022

Description

The Hnsw parameters like DEFAULT_MAX_CONN, and DEFAULT_BEAM_WIDTH should not be maintained in the codec-related class HnswVectorFormat but it's more reasonable to keep them in the HnswGraphBuilder class.

The HNSW parameters like MAXIMUM_MAX_CONN, DEFAULT_MAX_CONN, MAXIMUM_BEAM_WIDTH, DEFAULT_BEAM_WIDTH
should not be maintained in the codec-related class HnswVectorFormat but it's more reasonable
to keep them in the HnswGraphBuilder class
Copy link
Contributor

@alessandrobenedetti alessandrobenedetti left a comment

Choose a reason for hiding this comment

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

It seems reasonable to me, the max_conn and beam_width are used by (and passed as parameters) the graph builder.
It's ok to me to move the Defaults in there

@msokolov
Copy link
Contributor

msokolov commented Jan 1, 2023

Sorry, I don't see this being any better than the current situation; aside from tests, the parameters are only used in HnswVectorsFormat where they are currently defined, so I think we should leave them there.

@dantuzi
Copy link
Contributor Author

dantuzi commented Jan 12, 2023

@msokolov I'm finalizing another PR that works with HnswGraph and, to create the graph, I use the constants DEFAULT_MAX_CONN and DEFAULT_BEAM_WIDTH already defined. So, in the future, these constants will also be used outside the class HnswVectorsFormat.

@alessandrobenedetti
Copy link
Contributor

@msokolov do you see any reason why we shouldn't do it? because I reviewed the pull request Daniele is going to publish (Word2Vec for synonyms generation: https://www.youtube.com/watch?v=rKYJQhZxQFQ&t=469s) and having those constants in the HNSW Graph builder facilitates the things.
Furthermore, those constants in terms of responsibility affect how the graph is built(more than the codec), so in terms of cohesion of the class, it seems reasonable to me for them to be in the HNSW Graph builder.

@msokolov
Copy link
Contributor

msokolov commented Jan 25, 2023 via email

@alessandrobenedetti
Copy link
Contributor

Ok, that's fine! @dantuzi you can cancel this PR and just include the change in the final PR.
Thanks @msokolov for the suggestion!

@dantuzi dantuzi closed this Jan 26, 2023
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