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

Provide models with pre-computed neighbor lists during training #189

Open
Luthaf opened this issue May 17, 2024 · 0 comments
Open

Provide models with pre-computed neighbor lists during training #189

Luthaf opened this issue May 17, 2024 · 0 comments
Labels
Discussion Issues to be discussed by the contributors Infrastructure: CLI Related to the command line interface

Comments

@Luthaf
Copy link
Member

Luthaf commented May 17, 2024

This is split from #174 (comment). While discussion the interface for model training I though it might make sense to provide the models with pre-computed NL when training.

We already pre-compute these in inference mode, so doing the same for training mode makes sense to me. The interface could looks something like

class ModelInterface:
    ...

    def requested_neighbor_lists(self) -> [NeighborListOptions]:
        ...  # often the same set of NL as the exported model

# ==================================================================================== #

# training loop

if "continue_from_checkpoint":
    model = __MODEL_CLASS__.from_checkpoint("path")
    model = model.restart(dataset_info)
else:
    model = __MODEL_CLASS__(hypers["architecture"], dataset_info)

# NEW CODE HERE
for request in model.requested_neighbor_lists():
    for system in [train_datasets, validation_datasets]:
        neighbors = compute_nl(request, system)
        system.add_nl(request, neighbors)
# END OF NEW CODE

trainer = __TRAINER_CLASS__(hypers["train"])

trainer.train(
    model=model,
    devices=[...],
    train_datasets=[...],
    validation_datasets=[...],
    checkpoints_dir="path",
)
@Luthaf Luthaf changed the title Provide models with pre-computed neighbor lists Provide models with pre-computed neighbor lists during training May 17, 2024
@PicoCentauri PicoCentauri added Discussion Issues to be discussed by the contributors Infrastructure: CLI Related to the command line interface and removed infrastructure labels Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Issues to be discussed by the contributors Infrastructure: CLI Related to the command line interface
Projects
None yet
Development

No branches or pull requests

2 participants