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

add threshold_lo_ & threshold_hi_ #816

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/measure/active.cu
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ void Active::parse(const char** param, int num_param)
check_ = true;
printf("Active learning.\n");

if (num_param != 5) {
PRINT_INPUT_ERROR("active should have 4 parameters.");
if (num_param != 6) {
PRINT_INPUT_ERROR("active should have 5 parameters.");
}
if (!is_valid_int(param[1], &check_interval_)) {
PRINT_INPUT_ERROR("check interval should be an integer.");
Expand All @@ -141,13 +141,16 @@ void Active::parse(const char** param, int num_param)
} else {
printf(" with force data.\n");
}
if (!is_valid_real(param[4], &threshold_)) {
if (!is_valid_real(param[4], &threshold_lo_)) {
PRINT_INPUT_ERROR("threshold should be a real number.\n");
}
if (!is_valid_real(param[5], &threshold_hi_)) {
Comment on lines +144 to +147
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (!is_valid_real(param[4], &threshold_lo_)) {
PRINT_INPUT_ERROR("threshold should be a real number.\n");
}
if (!is_valid_real(param[5], &threshold_hi_)) {
if (!is_valid_real(param[4], &threshold_low_)) {
PRINT_INPUT_ERROR("threshold_low should be a real number.\n");
}
if (!is_valid_real(param[5], &threshold_high_)) {

PRINT_INPUT_ERROR("threshold should be a real number.\n");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
PRINT_INPUT_ERROR("threshold should be a real number.\n");
PRINT_INPUT_ERROR("threshold_high should be a real number.\n");

}

printf(
" will check if uncertainties exceed %f every %d iterations.\n",
threshold_,
" will check if uncertainties exceed %f and %f every %d iterations.\n",
threshold_lo_, threshold_hi_,
Comment on lines +152 to +153
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
" will check if uncertainties exceed %f and %f every %d iterations.\n",
threshold_lo_, threshold_hi_,
" will check if uncertainties exceed %f and are below %f every %d iterations.\n",
threshold_lo_, threshold_hi_,

check_interval_);
}

Expand Down Expand Up @@ -238,7 +241,7 @@ void Active::process(
}
}
write_uncertainty(step, global_time, uncertainty);
if (uncertainty > threshold_) {
if (threshold_hi_ > uncertainty && uncertainty > threshold_lo_) {
Copy link
Owner

@brucefan1983 brucefan1983 Dec 15, 2024

Choose a reason for hiding this comment

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

OK, it is correct. read it wrongly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (threshold_hi_ > uncertainty && uncertainty > threshold_lo_) {
if (threshold_high_ > uncertainty && uncertainty > threshold_low_) {

write_exyz(
step,
global_time,
Expand Down