Evaluates the trained network at new points.
Usage
# S3 method for class 'pinn_fit'
predict(object, newdata = NULL, ...)Arguments
- object
A
pinn_fit.- newdata
Data frame with one column per domain variable. When omitted, the
timesgiven topinn_ode()are used for ODE problems, and otherwise a regular grid (201 points in 1D, 101 x 101 in 2D).- ...
Unused.
Examples
decay <- function(t, y, parms) list(-parms["k"] * y)
prob <- pinn_ode(decay, y0 = c(y = 1), times = c(0, 5), parms = c(k = 0.5))
fit <- pinn_fit(prob, hidden = c(16, 16), epochs = 1000, seed = 1)
predict(fit, data.frame(time = c(0, 1, 2)))
#> time y
#> 1 0 1.0000000
#> 2 1 0.6344568
#> 3 2 0.3608426