ramannoodle.dataset.torch¶
Polarizability dataset for pytorch.
- class ramannoodle.dataset.torch.PolarizabilityDataset(lattice, atomic_numbers, positions, polarizabilities)¶
Bases:
Dataset[tuple[Tensor,Tensor,Tensor,Tensor]]PyTorch dataset of atomic structures and polarizabilities.
Polarizabilities are standard scaled and flattened into 6-vectors containing the independent tensor components.
- Parameters:
lattice (
ndarray[Any,dtype[float64]]) – (Å) Array with shape (3,3).atomic_numbers (
list[int]) – List of length N where N is the number of atoms.positions (
ndarray[Any,dtype[float64]]) – (fractional) Array with shape (S,N,3) where S is the number of samples.polarizabilities (
ndarray[Any,dtype[float64]]) – Array with shape (S,3,3).scale_mode – Supports
"standard"(standard scaling),"stddev"(division by standard deviation), and"none"(no scaling).
- scale_polarizabilities(mean, stddev)¶
Standard-scale polarizabilities given a mean and standard deviation.
This method may be used to scale validation or test datasets according to the mean and standard deviation of the training set, as is best practice.
- property atomic_numbers: list[int]¶
Get (a copy of) atomic numbers.
- Returns:
List of length N where N is the number of atoms.
- property mean_polarizability: ndarray[Any, dtype[float64]]¶
Get mean polarizability.
- Returns:
Array with shape (3,3).
- property polarizabilities: ndarray[Any, dtype[float64]]¶
Get (a copy of) polarizabilities.
- Returns:
Array with shape (S,3,3) where S is the number of samples.
- property positions: ndarray[Any, dtype[float64]]¶
Get (a copy of) positions.
- Returns:
Array with shape (S,N,3) where S is the number of samples and N is the number of atoms.
Submodules¶
ramannoodle.dataset.torch.utils module¶
Some torch utilities.
- ramannoodle.dataset.torch.utils.get_tensor_size_error(name, tensor, desired_size)¶
Get ValueError indicating a PyTorch Tensor has the wrong size.
- Return type:
- Parameters:
- ramannoodle.dataset.torch.utils.polarizability_tensors_to_vectors(polarizability_tensors)¶
Convert polarizability tensors to vectors.