Skip to content

Bug: Spin and charge get lost in optimizers #389

@niklashoelter

Description

@niklashoelter

Related to #253 #277 , initially adressed in #373

The passing of the spin and charge parameters from ASE to the Torchsim SimState works.
When passing this SimState through a single model iteration (tested with fairchem), also everything works fine.

The problem occurs in optimization runs - where the spin/charge information as far as I can see gets lost in the init_fn of the optimizer (I observed this using fire, but probably gradient_descent faces the same problem).
Suggested fix: Copy spin and charge from the SimState argument to the common_args dict in optimizers/fire.py init_fire().

Definitely need to check if the problem also persists in the step_fn, as attributes are also passed here - I am unsure about this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions