MixtureDatapoint#
- class cosmolayer.MixtureDatapoint(temperature, mole_fractions, areas, volumes, probabilities, targets)[source]#
Base dataclass for a mixture datapoint.
Stores physical inputs (temperature, mole fractions, areas, volumes, and segment-type probabilities) and optional training targets. Shape metadata is computed and validated automatically on construction.
- Parameters:
temperature (float) – Temperature.
mole_fractions (NumpyArray1D) – Mole fractions. Shape:
(num_components,).areas (NumpyArray1D) – Segment surface areas per component. Shape:
(num_components,).volumes (NumpyArray1D) – Molar volumes per component. Shape:
(num_components,).probabilities (NumpyArray2D) – Sigma-profile probabilities. Shape:
(num_components, num_segment_types).targets (NumpyArray1D) – Training targets. Shape:
(num_targets,).
- Variables:
- Raises:
ValueError – If array shapes are inconsistent.
Attributes
- shape#
Return the structural shape metadata for the datapoint.
Methods
- get_inputs(dtype=torch.float64)[source]#
Convert physical inputs to torch tensors.
- Parameters:
dtype (torch.dtype) – Data type used for all returned tensors. Default is
torch.float64.- Returns:
Temperature, mole fractions, areas, volumes, and probabilities as torch tensors.
- Return type:
InputsType
- get_targets(dtype=torch.float64)[source]#
Convert target arrays to torch tensors.
- Parameters:
dtype (torch.dtype) – Data type used for all returned tensors. Default is
torch.float64.- Returns:
Training targets as torch tensors.
- Return type:
Tensor1D