MaterSim / PyXtal_FF

Machine Learning Interatomic Potential Predictions
85 stars 23 forks source link

Train model on custom data? #53

Closed PythonFZ closed 1 year ago

PythonFZ commented 2 years ago

Hey PyXtal_FF team,

Is there any documentation available on how to create the input data for PyXtal_FF? The documentation starts with the provided JSON files but unfortunately I'm not familiar with the format or how to generate it.

I do have a list of ASE Atoms objects, with energies, forces and stresses available. The structure has periodic boundary conditions. What would be the best way to convert this data into a suitable PyXtal_FF input file?

Best Fabian

qzhu2017 commented 2 years ago

@PythonFZ Hi, ASE is actually the most convenient way for us. So, if you have ase.db file, just created some additional tag as follows,

    data = {'dft_energy': eng, #total energy
            'dft_force': forces,     #N*3 array
            'dft_stress': stress,    #1*6 stress [in GPa, xx, yy, zz, xy, xz, yz]
            'group': group}

    with connect(db_name) as db:
        db.write(struc, data=data)

Please note that ASE and VASP output the stress tensor in different orders and units. Make sure you follow the order of

xx, yy, zz, xy, xz, yz

and the unit of Gpa

The following code should give you some idea to organize you ase data https://github.com/qzhu2017/PyXtal_FF/blob/32cc4e7598a00a04c304e6ba15151a136d3177ca/pyxtal_ff/utilities/__init__.py#L596-L636

qzhu2017 commented 2 years ago
Gaurav-Arora-MatSci commented 1 year ago

Hello @PythonFZ Can you guide me in generating manual input data for training the potentials? I am not very familiar with ase or any other package. It would be very helpful if you could guide me through the beginning process.

Thank you

PythonFZ commented 1 year ago

Hello @PythonFZ Can you guide me in generating manual input data for training the potentials? I am not very familiar with ase or any other package. It would be very helpful if you could guide me through the beginning process.

Thank you

I'm not using PyXtal Force Fields so I can't help you with this specific package.

Gaurav-Arora-MatSci commented 1 year ago

Hello @PythonFZ Just sent you an email.