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

Enable model training on Hamiltonian matrix, wavefunction coefficients and energy levels. Supporting for mixed training. Enable some output. #85

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

xuan112358
Copy link

  1. Enable model training on electronic structrue properties:
    only for gamma only now
  • In scf_abacus.yaml : scf_abacus/init_scf_abacus

    • deepks_v_delta=1/2 : In SCF step, ABACUS will output files needed. When deepks_v_delta=2, ABACUS will output psialpha.npy and gevdm.npy instead of v_delta_precalc.npy, which largely save memory.
  • In params.yaml : train_input : train_args

    • Hamiltonian loss : Set v_delta_factor.
    • Wavefunction coefficients loss : Set psi_factor and psi_occ. It represents psi loss.
      • psi_occ is the number of psi considered in the loss function.
      • If you want to set the same psi_occ for all systems, set it as an integer.
      • Also support setting different psi_occ for systems with different atoms. Set psi_occ as a map, with n_atom as the key and the corresponding psi_occ number as value.
    • Energy level loss : Set band_factor and band_occ. Setting for band_occ is similar to psi_occ.
    • Density matrix loss loss : Set density_m_factor and density_m_occ. This loss term may have more physical implications than psi loss.
  • In params.yaml : train_input : data_agrs

    • Psi and energy level are calculated by generalized eigenvalue decomposition, which need to set read_overlap=True.
  1. Support for mixed training:
  • In params.yaml : train_input : train_args
    • Enable dividing energy loss with n_atom or n_atom^2. Set energy_per_atom=1/2. energy_per_atom=2 is more often used in mixed training.
    • Enable vd_divide_by_nlocal to make v_delta loss similar in magnitude for systems with different number of atoms. Set vd_divide_by_nlocal=True.
  1. Enable some output for clarity
  • Output detail loss for each loss term.
  • In params.yaml : train_input : train_args
    • Enable output detail test loss for each loss term. Set display_detail_test=True. The factors for these output test loss terms are all one.
    • Enable output train & test loss for systems with different atoms separately. Set display_natom_loss=True. Useful for mixed training.

Add deepks_v_delta=1 in scf_abacus.yaml : scf_abacus/init_scf_abacus. Set v_delta_factor in params.yaml : train_input : train_args
Additionally, output detail loss for each loss term for clarity.
Psi is calculated by generalized eigenvalue decomposition, which need to set read_overlap=True in params.yaml : train_input : data_agrs.
Set psi_factor and psi_occ in params.yaml : train_input : train_args.
Add deepks_v_delta=2 in scf_abacus.yaml : scf_abacus/init_scf_abacus. In this setting, ABACUS will output psialpha.npy and gevdm.npy instead of v_delta_precalc.npy, which largely save memory.
…when needed. This can save the largest memory needed.
…_test=True in params.yaml : train_input : train_args. The factors for these output test loss terms are all one.
… display_natom_loss=True in params.yaml : train_input : train_args. Useful for mixed training.
…tom=1/2 in params.yaml : train_input : train_args. energy_per_atom=2 is more often used in mixed training.
… Set psi_occ/band_occ as map, with n_atom as key and corresponding psi_occ/band_occ number as value.
…for systems with different number of atoms. Set vd_divide_by_nlocal=True in params.yaml : train_input : train_args.
… density_m_occ in params.yaml : train_input : train_args. This loss term may have more physical implications than psi loss.
@mohanchen mohanchen requested a review from y1xiaoc December 22, 2024 08:38
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

Successfully merging this pull request may close these issues.

1 participant