Changelog
Source:NEWS.md
pinnr 0.1.1
- Fixed intermittent
NaNor wrong losses withprecision = "float64". Coordinate and data tensors were built from one-column R matrices, whichtorch_tensor()does not copy for double precision, so they could point to memory that R had already freed. pinnr now always copies R data into tensors. The failure was seen most often on Apple Silicon Macs. - README: Intel Macs on macOS 14 or older need torch 0.16.3 or earlier.
pinnr 0.1.0
First release.
pinn_fit()no longer throws away the model when the loss becomesNaNor infinite. It keeps the weights with the lowest loss seen so far, restores them, and returns the fit with a warning anddiverged = TRUE.Output columns in
datawith no observed values are now dropped instead of making the data lossNaN. This could happen withwindows, where each window sees only its own slice of the data.plot(fit, type = "solution")draws 1D solutions on a dense grid, so ODE curves are smooth even whentimeshas few points.Window fits no longer store a copy of the whole problem in their
call.pinn_sample()(and therefore conditions) uses every combination of the fixed values when several variables are fixed, e.g. the four corners forwhere = list(x = "both", y = "both"), and gives every fixed value at least one point.Argument checks reject
NAinhiddenand infinite counts and rates with clear messages.pinn_ode()builds problems fromdeSolve-style ODE models, with exact initial conditions by default.pinn_problem()andpinn_domain()define PDE problems on rectangular domains; residuals are R functions with arguments matched by name and the derivative operatord().Conditions:
pinn_dirichlet(),pinn_neumann(),pinn_initial()andpinn_condition(), plus output transforms for hard constraints.Parameter estimation from partly observed, noisy data through
unknownanddata.pinn_fit()trains with Adam and optional L-BFGS, Latin hypercube sampling, resampling, time marching (windows) for long ODE horizons, GPU devices and single or double precision.Methods
predict(),residuals(),coef(),plot(),summary(), andpinn_save()/pinn_load().