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

introduce new train method for sq #227

Merged
merged 1 commit into from
Dec 23, 2024
Merged

introduce new train method for sq #227

merged 1 commit into from
Dec 23, 2024

Conversation

LHT129
Copy link
Collaborator

@LHT129 LHT129 commented Dec 17, 2024

No description provided.

@LHT129 LHT129 added the kind/improvement Code improvements (variable/function renaming, refactoring, etc. ) label Dec 17, 2024
@LHT129 LHT129 requested a review from inabao December 17, 2024 11:19
@LHT129 LHT129 self-assigned this Dec 17, 2024
@LHT129 LHT129 force-pushed the sq8_train branch 3 times, most recently from b94ca10 to 75b9517 Compare December 18, 2024 10:27
auto ignore_count = static_cast<uint64_t>(static_cast<float>(count - 1) * 0.001);

for (uint64_t i = 0; i < dim_; ++i) {
upper_bound[i] = std::numeric_limits<float>::lowest();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unnecessary initialization

std::priority_queue<float, std::vector<float>, std::greater<>> heap_max;
std::priority_queue<float, std::vector<float>, std::less<>> heap_min;
heap_max.emplace(upper_bound[i]);
heap_min.emplace(lower_bound[i]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need for initial values in advance

uint64_t count,
float* upper_bound,
float* lower_bound) const {
auto ignore_count = static_cast<uint64_t>(static_cast<float>(count - 1) * 0.001);
Copy link
Collaborator

Choose a reason for hiding this comment

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

what happened when count = 0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

never

Copy link
Collaborator

@inabao inabao left a comment

Choose a reason for hiding this comment

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

LGTM

@LHT129 LHT129 merged commit 0d2dfa2 into antgroup:main Dec 23, 2024
7 checks passed
@LHT129 LHT129 deleted the sq8_train branch December 23, 2024 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement Code improvements (variable/function renaming, refactoring, etc. ) size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants