Skip to content

Add 1xnr model (new format)#670

Open
IgnacioJPickering wants to merge 10 commits intomainfrom
feature/ipickering/add-ani-1xnr
Open

Add 1xnr model (new format)#670
IgnacioJPickering wants to merge 10 commits intomainfrom
feature/ipickering/add-ani-1xnr

Conversation

@IgnacioJPickering
Copy link
Contributor

@IgnacioJPickering IgnacioJPickering commented Nov 13, 2025

This PR adds support for ANI-1xnr.

I wanted to double check what was the level of theory this model was trained on (docstring says BLYP-TZV2P) since I'm getting "strange" energy results. The absolute energy values are significantly different from 1x and 2x. Is this normal?

For example for the following molecule:

        species = torch.tensor(
            [[6, 8, 7, 1, 1, 1, 1, 1]], dtype=torch.long
        )
        coords = torch.tensor(
            [
                [
                    [0.8715798227, 0.1619958512, 0.0322465836],
                    [0.0824525507, -0.6745183984, -0.7728562897],
                    [-1.2366803437, -0.3917257278, -0.6407828312],
                    [1.3846786207, -0.5081762833, 0.7522303382],
                    [0.2593533005, 0.9062281629, 0.5764446979],
                    [1.6258014512, 0.7033308948, -0.5701975001],
                    [-1.6685247073, -0.8348361119, 0.1963280892],
                    [-1.3186606949, 0.6377016126, -0.6093561983],
                ]
            ],
            dtype=torch.float32,
        )

The energy is around -34 Ha, but it is around -170 Ha for 1x and 2x. The atomic self energies are also significantly different.

If this looks good to you, you can add a commit so the PR is shared, and I will merge (I have given you write-access to the repo, so you should be able to do this, no problem).

Note that the actual model used in the repo now lives on https://huggingface.co/roitberg-group/ani1xnr since the neurochem format is a pain, so I converted all models to pytorch state dicts

@IgnacioJPickering IgnacioJPickering changed the title feature/ipickering/add ani 1xnr Add 1xnr model (new format) Nov 13, 2025
@IgnacioJPickering
Copy link
Contributor Author

@JMorado I've cherry picked one of your commits so that you show up as co-author of the PR. I'm still not sure about the model however, the forces seem logical, but the energies are very strange.

I thought that maybe since the model was trained with PBC, with VASP? or something like that, maybe you used some approximation in the basis set/level of theory that shifts all the energies.

I've calculated the same molecule with orca with BLYP TZVPP and I get a result similar to ANI2x / ANI1x

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.

2 participants