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

Question about _normalize_feat function #1

Open
AaamberW opened this issue Jan 31, 2022 · 3 comments
Open

Question about _normalize_feat function #1

AaamberW opened this issue Jan 31, 2022 · 3 comments

Comments

@AaamberW
Copy link

AaamberW commented Jan 31, 2022

Could you help me understanding what this function does? Looks like cur_feat was modified(line 267-270) but not returned or used afterwards. Thanks!

@AliVard
Copy link
Owner

AliVard commented Jan 31, 2022

cur_feat is a pointer to feature_matrix[s_i:e_i,:], so any change on cur_feat is reflected on that part of feature_matrix.
The function normalizes feature_matrix inplace.

@AaamberW
Copy link
Author

Thanks, could you also comment on why qid:qid+2 for every start and end index pair?

@AliVard
Copy link
Owner

AliVard commented Feb 1, 2022

You're welcome.
query_ranges[qid] contains the start index of query qid.
s_i, e_i = query_ranges[qid:qid+2] is a short version for:
s_i = query_ranges[qid] and e_i = query_ranges[qid+1]

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

2 participants