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

Fix innerproduct function to match Dot Product #1004

Merged
merged 5 commits into from
Sep 1, 2022

Conversation

Naarcha-AWS
Copy link
Collaborator

Signed-off-by: Naarcha-AWS [email protected]

Issues Resolved

Fixes #397

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@Naarcha-AWS Naarcha-AWS added backport 2.0 PR: Backport label for v2.0.x backport 2.1 PR: Backport label for 2.1 backport 2.2 PR: Backport label for 2.2 labels Aug 25, 2022
@Naarcha-AWS Naarcha-AWS self-assigned this Aug 25, 2022
@Naarcha-AWS Naarcha-AWS requested a review from a team as a code owner August 25, 2022 17:38
@Naarcha-AWS Naarcha-AWS added 3 - Tech review PR: Tech review in progress backport 2.x and removed backport 2.0 PR: Backport label for v2.0.x backport 2.1 PR: Backport label for 2.1 backport 2.2 PR: Backport label for 2.2 labels Aug 25, 2022
Signed-off-by: Naarcha-AWS <[email protected]>
@Naarcha-AWS Naarcha-AWS added backport 2.0 PR: Backport label for v2.0.x backport 2.1 PR: Backport label for 2.1 backport 2.2 PR: Backport label for 2.2 4 - Doc review PR: Doc review in progress and removed backport 2.x 3 - Tech review PR: Tech review in progress labels Aug 29, 2022
@@ -313,7 +313,7 @@ A space corresponds to the function used to measure the distance between two poi
</tr>
<tr>
<td>innerproduct</td>
<td>\[ Distance(X, Y) = \sum_{i=1}^n (X_i - Y_i) \]</td>
<td>\[ Distance(X, Y) = \sum_{i=1}^n (X_i * Y_i) \]</td>
Copy link
Collaborator

@kolchfa-aws kolchfa-aws Aug 29, 2022

Choose a reason for hiding this comment

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

Should we use the math multiplication sign (dot) instead of the programming multiplication sign (*) here? Or we can omit the multiplication sign altogether because multiplication is implicit in math. If you omit the multiplication sign, parentheses are not needed here.

In general, should we denote vectors as lowercase(or uppercase) bold letters and scalars as lowercase non-bold letters? I think this notation is easier to understand and is the default mathematical notation for vectors.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Switched to dot. Let's address the 2nd comment in a different issue, since that would require changing more than just this formula.

Signed-off-by: Naarcha-AWS <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Copy link
Collaborator

@kolchfa-aws kolchfa-aws left a comment

Choose a reason for hiding this comment

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

LGTM

@Naarcha-AWS Naarcha-AWS merged commit d65b56f into main Sep 1, 2022
@Naarcha-AWS Naarcha-AWS deleted the innerproduct-scriptscoring branch September 1, 2022 18:45
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 1, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 1, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 1, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)
Naarcha-AWS added a commit that referenced this pull request Sep 1, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)

Co-authored-by: Naarcha-AWS <[email protected]>
Naarcha-AWS added a commit that referenced this pull request Sep 1, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)

Co-authored-by: Naarcha-AWS <[email protected]>
Naarcha-AWS added a commit that referenced this pull request Sep 1, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)

Co-authored-by: Naarcha-AWS <[email protected]>
@Naarcha-AWS Naarcha-AWS added the backport 1.3 PR: Backport label for v1.3.x label Sep 7, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 7, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)
@Naarcha-AWS Naarcha-AWS added backport 1.2 PR: Backport label for 1.2 backport 1.1 PR: Backport label for 1.1 labels Sep 7, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 7, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 7, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)
Naarcha-AWS added a commit that referenced this pull request Sep 7, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)

Co-authored-by: Naarcha-AWS <[email protected]>
@Naarcha-AWS Naarcha-AWS added the backport 1.0 PR: Backport label for 1.0 label Sep 7, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 7, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)
Naarcha-AWS added a commit that referenced this pull request Sep 8, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)

Co-authored-by: Naarcha-AWS <[email protected]>
Naarcha-AWS added a commit that referenced this pull request Sep 8, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)

Co-authored-by: Naarcha-AWS <[email protected]>
Naarcha-AWS added a commit that referenced this pull request Sep 8, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
(cherry picked from commit d65b56f)

Co-authored-by: Naarcha-AWS <[email protected]>
Naarcha-AWS added a commit that referenced this pull request Oct 6, 2022
* Fix innerproduct function to match Dot Product

Signed-off-by: Naarcha-AWS <[email protected]>

* Fix formatting

Signed-off-by: Naarcha-AWS <[email protected]>

* Use dot instead

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove parenthesies

Signed-off-by: Naarcha-AWS <[email protected]>

* Remove space

Signed-off-by: Naarcha-AWS <[email protected]>

Signed-off-by: Naarcha-AWS <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - Doc review PR: Doc review in progress backport 1.0 PR: Backport label for 1.0 backport 1.1 PR: Backport label for 1.1 backport 1.2 PR: Backport label for 1.2 backport 1.3 PR: Backport label for v1.3.x backport 2.0 PR: Backport label for v2.0.x backport 2.1 PR: Backport label for 2.1 backport 2.2 PR: Backport label for 2.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] incorrect distance metric formula for innerproduct in knn scriptscoring
3 participants