evaluate_1darray_function_on_2d_array

pyapprox.interface.evaluate_1darray_function_on_2d_array(function, samples, statusbar=False, return_grad=False)[source]

Evaluate a function at a set of samples using a function that only takes one sample at a time

Parameters:
functioncallable

A function with signature

function(sample) -> np.ndarray`

where sample is a 1d np.ndarray of shape (num_vars) and the output is a np.ndarray of values of shape (num_qoi). The output can also be a scalar

samplesnp.ndarray (num_vars, num_samples)

The samples at which to evaluate the model

statusbarboolean

True - print status bar showing progress to stdout False - do not print

return_gradboolean

True - values and return gradient False - return just gradient If function does not accept the return_grad kwarg an exception will

be raised

Returns:
valuesnp.ndarray (num_samples, num_qoi)

The value of each requested QoI of the model for each sample