romtools.rom.qoi_surrogates#

Classes

GaussianProcessKernel([length_scale, ...])

GaussianProcessQoiModel(parameters, qois[, ...])

Gaussian Process QoI surrogate model that follows the QoiModel API.

GaussianProcessRegressorLite([kernel, ...])

NeuralNetworkConfig([num_hidden_layers, ...])

Configuration for the torch neural-network QoI surrogate.

NeuralNetworkQoiModel(parameters, qois[, ...])

Torch neural-network QoI surrogate following the QoiModel API.

class romtools.rom.qoi_surrogates.GaussianProcessKernel(length_scale: 'float' = 1.0, signal_variance: 'float' = 1.0)[source]#

Bases: object

Parameters:
  • length_scale (float)

  • signal_variance (float)

class romtools.rom.qoi_surrogates.GaussianProcessQoiModel(parameters, qois, parameter_names=None, pod_energy_fraction=0.999999, max_pod_modes=None, kernel=None, noise_variance=None, auto_noise_variance=False, noise_variance_fraction=1e-06, tune_hyperparameters=False, length_scale_grid=None, signal_variance_grid=None, normalize_parameters=False, normalize_targets=False)[source]#

Bases: object

Gaussian Process QoI surrogate model that follows the QoiModel API.

For vector QoIs, a POD is performed and a GP is trained for each reduced coefficient.

Parameters:
  • parameters (np.ndarray)

  • qois (np.ndarray)

  • parameter_names (Optional[Sequence[str]])

  • pod_energy_fraction (float)

  • max_pod_modes (Optional[int])

  • kernel (Optional[GaussianProcessKernel])

  • noise_variance (Optional[float])

  • auto_noise_variance (bool)

  • noise_variance_fraction (float)

  • tune_hyperparameters (bool)

  • length_scale_grid (Optional[Sequence[float]])

  • signal_variance_grid (Optional[Sequence[float]])

  • normalize_parameters (bool)

  • normalize_targets (bool)

class romtools.rom.qoi_surrogates.NeuralNetworkConfig(num_hidden_layers=2, hidden_neurons_per_layer=None, hidden_width_multiplier=3.0, activation='tanh', optimizer='adam', learning_rate=0.001, training_iterations=5000, weight_decay=0.0, random_seed=1, dtype='float64', device='cpu')[source]#

Bases: object

Configuration for the torch neural-network QoI surrogate.

The default architecture contains two hidden layers. If hidden_neurons_per_layer is not provided, each hidden layer contains hidden_width_multiplier * parameter_dimension neurons, giving the baseline width of three times the parameter dimension.

Parameters:
  • num_hidden_layers (int)

  • hidden_neurons_per_layer (int | None)

  • hidden_width_multiplier (float)

  • activation (str)

  • optimizer (str)

  • learning_rate (float)

  • training_iterations (int)

  • weight_decay (float)

  • random_seed (int)

  • dtype (str)

  • device (str)

class romtools.rom.qoi_surrogates.NeuralNetworkQoiModel(parameters, qois, parameter_names=None, pod_energy_fraction=0.999999, max_pod_modes=None, network_config=None, normalize_parameters=True, normalize_targets=True)[source]#

Bases: object

Torch neural-network QoI surrogate following the QoiModel API.

Scalar QoIs are learned directly. Vector QoIs use the same POD reduction strategy as GaussianProcessQoiModel: the training QoIs are mean-centered, truncated according to pod_energy_fraction and max_pod_modes, and the network predicts the retained POD coefficients. A single multi-output network is used for all retained coefficients.

Parameters:
  • parameters (np.ndarray)

  • qois (np.ndarray)

  • parameter_names (Optional[Sequence[str]])

  • pod_energy_fraction (float)

  • max_pod_modes (Optional[int])

  • network_config (Optional[NeuralNetworkConfig])

  • normalize_parameters (bool)

  • normalize_targets (bool)