Function#
- class pinnx.problem.Function(geometry, function, num_train, num_test, train_distribution='uniform', online=False, approximator=None, loss_fn='MSE', loss_weights=None)[source]#
Approximate a function via a network.
- Parameters:
geometry (
AbstractGeometry) – The domain of the function. Instance ofGeometry.function (
Callable) – The function to be approximated. A callable function takes a NumPy array as the input and returns the a NumPy array of corresponding function values.num_train (
int) – The number of training points sampled inside the domain.num_test (
int)train_distribution (
str) – The distribution to sample training points. One of the following: “uniform” (equispaced grid), “pseudo” (pseudorandom), “LHS” (Latin hypercube sampling), “Halton” (Halton sequence), “Hammersley” (Hammersley sequence), or “Sobol” (Sobol sequence).online (
bool) – IfTrue, resample the pseudorandom training points every training step, otherwise, use the same training points.