AFL.double_agent.TensorFlowExtrapolator module#
Extrapolators take discrete sample data and extrapolate the data onto a provided grid.
This file segments all extapolators that require tensorflow.
- class AFL.double_agent.TensorFlowExtrapolator.TFExtrapolator(feature_input_variable: str, predictor_input_variable: str, output_variables: List[str], output_prefix: str, grid_variable: str, grid_dim: str, sample_dim: str, optimize: bool, name: str = 'Extrapolator')#
Bases:
PipelineOp
Base class for all tensorflow based extrapolators
- Parameters:
feature_input_variable (str) – The name of the xarray.Dataset data variable to use as the input to the model that will be extrapolating the discrete data. This is typically a sample composition variable.
predictor_input_variable (str) – The name of the xarray.Dataset data variable to use as the output of the model that will be extrapolating the discrete data. This is typically a class label or property variable.
output_variables (List[str]) – The list of variables that will be output by this class.
output_prefix (str) – The string prefix to apply to each output variable before inserting into the output xarray.Dataset
grid_variable (str) – The name of the xarray.Dataset data variable to use as an evaluation grid.
grid_dim (str) – The xarray dimension over each grid_point. Grid equivalent to sample.
sample_dim (str) – The xarray dimension over the discrete ‘samples’ in the feature_input_variable. This is typically a variant of sample e.g., saxs_sample.
optimize (bool) – Whether to optimize the model parameters
name (str, default="Extrapolator") – The name to use when added to a Pipeline
- calculate(dataset: Dataset) Self #
Apply this PipelineOp to the supplied xarray.Dataset
- encode(labels)#
- invert_encoded(labels)#
- class AFL.double_agent.TensorFlowExtrapolator.TFGaussianProcessClassifier(feature_input_variable: str, predictor_input_variable: str, output_prefix: str, grid_variable: str, grid_dim: str, sample_dim: str, optimize: bool = True, kernel: str = 'Matern32', kernel_kwargs: dict = {'lengthscales': 0.1, 'variance': 0.1}, name: str = 'TFGaussianProcessClassifier')#
Bases:
TFExtrapolator
Use a Gaussian process classifier to extrapolate class labels at discrete compositions onto a composition grid
- calculate(dataset: Dataset) Self #
Apply this PipelineOp to the supplied xarray.Dataset