ode_TrainingBVP_Hard

Functions which trains a model for solving a solveODE_BVP call with hard constraints implemented in TensorFlow.

While available to user, not meant to be used. Meant to be used through object returned from solveODE calls, where training file is selected through ode_trainingSelect

PINNtrain_BVP_Hard(de_points, inits, order, t_bdry, epochs, eqn, net_layers, net_units, model)

Main function called by PINNtrainSelect_Standard when solving hard constraint BVP.

Parameters:
  • de_points (list) –

    Randomly sampled points for network to train with.

  • inits (list) –

    Inital boundary values for network to learn

  • order (int) –

    Order of equation to be solved

  • t_bdry (list) –

    Interval for equation to be solved on. User input t_bdry

  • epochs (int) –

    Number of epochs for network to train

  • eqn (string) –

    Equation to solve. User input eqn

  • net_layers (int) –

    Number of internal layers of network

  • net_units (int) –

    Number of nodes for each internal layer

  • model (PINN or None) –

    User input model. Defaulted to None and model created in function with call to ode_ModelFuncs

Returns:
  • epoch_loss( list ) –

    Total loss over training of model

  • ivp_loss( list ) –

    Inital boundary value loss over training of model. Will be all zeroes as hard constrainting

  • de_loss( list ) –

    Differential equation loss over training of model

  • model( PINN ) –

    Trained model to predict equation(s) over t

Packages data correctly and calls train_network_general_BVP_Hard in executing training routine, and handles optimization of the network.

train_network_BVP_Hard(odes, model, eqnparam)

Function which does the training for a single epoch

Parameters:
  • odes (list) –

    Sampled de points network uses to train

  • model (PINN) –

    Model to train

  • eqnparam (string) –

    Equation to solve.

Generates derivatives of model using automatic differentiation. Computes mean squared error of loss along odes points.

Returns:
  • DEloss( list ) –

    Loss of training network to match function along odes points

  • grads( array ) –

    Gradients of network for optimization