Skip to content

Fix issue in quantization - #7

Closed
askibinski wants to merge 5 commits into
allanpichardo:mainfrom
askibinski:main
Closed

Fix issue in quantization#7
askibinski wants to merge 5 commits into
allanpichardo:mainfrom
askibinski:main

Conversation

@askibinski

Copy link
Copy Markdown

This fixes the quantization issue as described and fixed by @therealgaxbo (thank you kind stranger!) on reddit:

https://www.reddit.com/r/PHP/comments/1dwcjig/comment/lc296ud/

Comment thread composer.json Outdated
@@ -1,14 +1,19 @@
{
"name": "allanpichardo/mysql-vector",
"name": "askibinski/mysql-vector",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file shouldn't get changed in the PR

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes the PR is wrong, thanks for pointing out

Comment thread src/VectorTable.php Outdated

return $this->binaryToHexadecimal($padded);
}
private function vectorToHex(array $vector): string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can public stay public please? Otherwise we can no longer extend. Or at least protected instead of private, but either way seems like a bit of scope creep here

@scotteuser

Copy link
Copy Markdown
Contributor

This works well;

Given this list of items:

  • Tomato soup
  • Chocolate cake
  • Vanilla ice cream

Before the PR a search for 'Warm dessert' gets Chocolate cake first, but Tomato soup second.
After the PR a search for 'Warm dessert' gets Chocolate cake first, and Vanilla ice cream second.

Ie, secondary results are closer vector in relation after the PR as far as I can tell.

Beyond that added some minor comments

@askibinski
askibinski marked this pull request as draft February 25, 2025 10:33
@askibinski
askibinski marked this pull request as ready for review February 25, 2025 10:49

@scotteuser scotteuser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me, thanks! 'Approved' FWIW :)

@askibinski askibinski closed this Feb 27, 2025
@askibinski

Copy link
Copy Markdown
Author

See #8 for the new PR from a different branch (Needed the main branch)

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.

2 participants