pde_TrainingDeepONetICBCP_periodic_soft

Functions which trains a model for solving a solvePDE_DeepONet_tx call with periodic boundaries and soft constraint implemented in TensorFlow.

While available to user, not meant to be used. Meant to be used through object returned from solvePDE calls, where training file is selected through pde_trainingSelects.PINNtrainSelect_DeepONet_tx()

train(pde_points, inits, u_sensors, t_order, epochs, model, eqn, N_iv, extra_ders)

Main function called by PINNtrainSelect_DeepONet_tx when solving equation in tx with periodic boundaries with soft constraint.

Parameters:
  • pde_points (list) –

    pde_points returned from defineCollocationPoints_DON_tx()

  • inits (list) –

    inits returned from defineCollocationPoints_DON_tx()

  • u_sensors (list) –

    usensors returned from defineCollocationPoints_DON_tx()

  • t_order (int) –

    Order of t in equation

  • epochs (int) –

    Number of epochs model gets trained for

  • model (DeepONet) –

    Model created from pde_DeepONetModelFuncs_2var or input model

  • eqn (string) –

    Equation to be solved

  • N_iv (int) –

    Number of randomly sampled collocation points along inital t which DeepONet uses in training.

  • extra_ders (list) –

    Extra derivatives needed to be computed for user equation

Returns:
  • epoch_loss( list ) –

    Total loss over training of model

  • iv_loss( list ) –

    Inital value loss over training of model

  • bc_loss( list ) –

    Boundary condition loss over training of model

  • pde_loss( list ) –

    Differential equation loss over training of model

  • model( DeepONet ) –

    Trained model to predict equation solution

Packages data correctly and calls train_network in executing training routine.

train_network(pdes, inits, uIn, t_order, opt, model, equation, extra_ders)

Function which does the training for a single epoch

Parameters:
  • pdes (list) –

    Sampled pde points network uses to train

  • inits (list) –

    Inital value points for learning initial conditon

  • uIn (list) –

    Sensor points network uses to train

  • t_order (int) –

    Order of equation to solve

  • opt (Optimizer) –

    Keras.Optimizer.Adam optimizer

  • model (DeepONet) –

    Model to train

  • equation (string) –

    Equation to solve

  • extra_ders (list) –

    Extra derivatives needed to be computed for user equation

Generates derivatives of model using automatic differentiation. Computes mean squared error of loss along pdes points and inital values. Also handles optimization of the network.

Returns:
  • loss( list ) –

    Total loss of training network during epoch

  • PDEloss( list ) –

    Loss of training network to match function along pdes points

  • BCloss( list ) –

    Loss of training network to match boundary values