CombinationSparseGrid
- class pyapprox.surrogates.CombinationSparseGrid(num_vars, basis_type='barycentric')[source]
Bases:
SubSpaceRefinementManager
Adaptive sparse grid that uses the combination technique.
Methods Summary
__call__
(samples[, return_grad])config values are ignored.
add_new_subspaces
(new_subspace_indices)Evaluate the sparse grid at self.canonical_interrogation_samples.
evaluate_using_all_data
(samples)Evaluate sparse grid using all subspace indices including active subspaces.
get_subspace_samples
(subspace_index, ...)Must be implemented by derived class This function should only be called when updating grid not interogating grid
moments
()moments_
(smolyak_coefficients)save
(filename)set_interrogation_samples
(samples)Set samples which are used to evaluate a sparse grid repeatedly.
set_univariate_rules
(univariate_quad_rule[, ...])setup
(function, config_variables_idx, ...[, ...])Methods Documentation
- __call__(samples, return_grad=False)[source]
config values are ignored. The sparse grid just returns its best approximation of the highest fidelity model. TODO: consider enforcing that samples do not have configure variables
- evaluate_at_interrogation_samples()[source]
Evaluate the sparse grid at self.canonical_interrogation_samples.
Note, this fuction only uses subspaces which are not active
- evaluate_using_all_data(samples)[source]
Evaluate sparse grid using all subspace indices including active subspaces. __call__ only uses subspaces which are not active
- get_subspace_samples(subspace_index, unique_poly_indices)[source]
Must be implemented by derived class This function should only be called when updating grid not interogating grid
- set_interrogation_samples(samples)[source]
Set samples which are used to evaluate a sparse grid repeatedly. If provided each time a subspace is added the subspace is evaluated at these points so that when self.evaluate_at_interrogation_samples is called no major computations are required. Note the reduced time complexity requires more storage
- Parameters:
- samplesnp.ndarray (num_vars) or (num_vars-num_config_vars)
Samples at which to evaluate the sparae grid. If config values are provided they are ignored.