cdvae icon indicating copy to clipboard operation
cdvae copied to clipboard

Using your evaluation script (compute_metrics.py)

Open anshumansinha16 opened this issue 1 year ago • 1 comments

Hi, thanks for the repository.

I wanted to use your metrics script to evaluate generated structures from mp_20 dataset. I have the training dataset and the generated dataset both in .cif format. I wish to ask, how may I use your script to evaluate the performance of my model?

As per my understanding we need of compute_metrics.py in order to get the crystal list we need to convert the .cif structure to a data dictionary with keys : {frac_coords, atom_types, lengths, angles, num_atoms}.

How to get these values for the above keys from my .cif file ?

compute_metrics.py : https://github.com/txie-93/cdvae/blob/f857f598d6f6cca5dc1ea0582d228f12dcc2c2ea/scripts/compute_metrics.py#L267

def get_crystal_array_list(file_path, batch_idx=0):

    data = load_data(file_path)

    crys_array_list = get_crystals_list(
        data['frac_coords'][batch_idx],
        data['atom_types'][batch_idx],
        data['lengths'][batch_idx],
        data['angles'][batch_idx],
        data['num_atoms'][batch_idx])

anshumansinha16 avatar Aug 05 '23 16:08 anshumansinha16

Hi, I think if you have the .cif structure, you could get all these parameters by feeding the cif to the 'Structure' class in pymatgen. Details can be found in cdvae/common/data_utils.py

confymacs avatar Dec 05 '23 14:12 confymacs