apax-hub / apax

A flexible and performant framework for training machine learning potentials.
https://apax.readthedocs.io
MIT License
18 stars 3 forks source link

prepare for ZnTrack v0.8.0 release #356

Closed PythonFZ closed 4 days ago

PythonFZ commented 1 month ago

Works like

Training a Model within apax

from apax.nodes import AddData, Apax
import zntrack

project = zntrack.Project()

with project:
    train = AddData(file="data/cosmo_water_train.xyz")
    test = AddData(file="data/cosmo_water_test.xyz")

    model = Apax(
        data=train.frames,
        validation_data=test.frames,
        config="config.yaml",
    )

project.repro()

and loading it from rev should now work just fine

import zntrack
from ase.build import molecule
import os

os.chdir("/tmp")

model = zntrack.from_rev("Apax", remote="/Users/fzills/tools/apax/models")
water = molecule("H2O")
water.calc = model.get_calculator()
water.get_forces()