romtools.rom.qoi_surrogates#
Classes
|
|
|
Gaussian Process QoI surrogate model that follows the QoiModel API. |
|
|
|
Configuration for the torch neural-network QoI surrogate. |
|
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:
objectGaussian 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:
objectConfiguration for the torch neural-network QoI surrogate.
The default architecture contains two hidden layers. If
hidden_neurons_per_layeris not provided, each hidden layer containshidden_width_multiplier * parameter_dimensionneurons, 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:
objectTorch 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 topod_energy_fractionandmax_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)