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

Support batch optimization in linemin #429

Open
lkwagner opened this issue Feb 20, 2024 · 1 comment
Open

Support batch optimization in linemin #429

lkwagner opened this issue Feb 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@lkwagner
Copy link
Contributor

After discussion with Will, we came up with the following improvement:

The call signature of line minimimization is:

def line_minimization(
    wf,
    coords,
    pgrad_acc,
    steprange=0.2,
    max_iterations=30,
    warmup_options=None,
    vmcoptions=None,
    lmoptions=None,
    correlatedoptions=None,
    update_kws=None,
    verbose=False,
    npts=5,
    hdf_file=None,
    client=None,
    npartitions=None,
):

The proposed change would allow pgrad_acc (the updater, such as StochasticReconfiguration) to be a list of updater objects. Linemin will proceed as normal except

    for it in range(iteration_offset, max_iterations):

becomes

    for it in range(iteration_offset, max_iterations):
        for micro_it in range(micro_it_offset, len(pgrad_acc)):

The variables now have an extra index; i.e., energy would be [iteration, micro_iteration] and the micro iteration is saved in the HDF5 file.

@lkwagner lkwagner added the enhancement New feature or request label Feb 20, 2024
@lkwagner
Copy link
Contributor Author

Ah, and gradient_generator can now take a batch parameter which does some reasonable automatic partitioning of batches. I was thinking by key, and anymo_coeff parameters also separated by orbital.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant