kliff.trainer.utils.dataloaders¶
- class kliff.trainer.utils.dataloaders.NeighborListDataset(dataset)[source]¶
TODO: format this dataset option batch should return a tuple of (species, config, neighbor_list, neighbors, contribution_index)
- class kliff.trainer.utils.dataloaders.DescriptorDataset(dataset, property_keys=('energy', 'forces', 'stress'))[source]¶
This class is a wrapper for the
torch.utils.data.Datasetclass to enable the use ofkliff.dataset.Datasetas a data source for the descriptor based models. It returns the fingerprint, properties and contribution index for each configuration.- Parameters:
dataset (
Dataset) –kliff.dataset.Datasetinstance.property_keys (
Union[Tuple,List]) – List of property keys to be used for the training. Default is (“energy”, “forces”, “stress”). These properties should be present on every configuration in the dataset. Among the provided list of properties, any property that is not present in any configuration will be ignored for all configurations.
- collate(batch)[source]¶
Collate function for the dataset. This function takes in a batch of configurations and properties and returns the collated configuration, properties and contribution index tensors. :type batch:
Any:param batch: list of configurations and properties for each configuration.- Returns:
collated configuration, properties and contribution index tensors.
- Return type:
dict