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

fixed scaler only #727

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions src/main_nep/dataset.cu
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ std::vector<float> Dataset::get_rmse_force(Parameters& para, const bool use_weig
return rmse_array;
}

#ifndef USE_FIXED_SCALER
static __global__ void
gpu_get_energy_shift(int* g_Na, int* g_Na_sum, float* g_pe, float* g_pe_ref, float* g_energy_shift)
{
Expand Down Expand Up @@ -472,7 +471,6 @@ gpu_get_energy_shift(int* g_Na, int* g_Na_sum, float* g_pe, float* g_pe_ref, flo
g_energy_shift[bid] = diff;
}
}
#endif

static __global__ void gpu_sum_pe_error(
float energy_shift, int* g_Na, int* g_Na_sum, float* g_pe, float* g_pe_ref, float* error_gpu)
Expand Down Expand Up @@ -523,7 +521,6 @@ std::vector<float> Dataset::get_rmse_energy(
const int block_size = 256;
int mem = sizeof(float) * Nc;

#ifndef USE_FIXED_SCALER
if (do_shift) {
gpu_get_energy_shift<<<Nc, block_size, sizeof(float) * block_size>>>(
Na.data(), Na_sum.data(), energy.data(), energy_ref_gpu.data(), error_gpu.data());
Expand All @@ -533,7 +530,6 @@ std::vector<float> Dataset::get_rmse_energy(
}
energy_shift_per_structure /= Nc;
}
#endif

gpu_sum_pe_error<<<Nc, block_size, sizeof(float) * block_size>>>(
energy_shift_per_structure,
Expand Down
2 changes: 0 additions & 2 deletions src/main_nep/fitness.cu
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,10 @@ void Fitness::report_error(
float rmse_force_train = rmse_force_train_array.back();
float rmse_virial_train = rmse_virial_train_array.back();

#ifndef USE_FIXED_SCALER
// correct the last bias parameter in the NN
if (para.train_mode == 0 || para.train_mode == 3) {
elite[para.number_of_variables_ann - 1] += energy_shift_per_structure;
}
#endif

float rmse_energy_test = 0.0f;
float rmse_force_test = 0.0f;
Expand Down
4 changes: 0 additions & 4 deletions src/main_nep/snes.cu
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ void SNES::initialize_mu_and_sigma(Parameters& para)
}
fclose(fid_restart);
}
#ifdef USE_FIXED_SCALER
mu[para.number_of_variables_ann - 1] = 0.0f;
sigma[para.number_of_variables_ann - 1] = 0.0f;
#endif
cudaSetDevice(0); // normally use GPU-0
gpu_mu.copy_from_host(mu.data());
gpu_sigma.copy_from_host(sigma.data());
Expand Down
Loading