deeponet

Class which implements a deeponet architecture

deeponet

Class implementing a deeponet architecture

__init__(data, eqns, layers=4, units=60, inner_act='tanh', out_act='linear', constraint='soft')

Constructor for class.

Parameters:
  • data (data) –

    Data to solve on deeponet.

  • eqns (list) –

    List of eqns to solve as strings. Spatial dimensions x1, x2, etc. Time dimension t. If a single equation, use u, if multiple, u1, u2, etc. See tutorials how to do specific examples.

  • layers (int, default: 4 ) –

    Number of internal layers for deeponet.

  • units (int, default: 60 ) –

    Number of units for internal layers for deeponet.

  • inner_act (string, default: 'tanh' ) –

    Activation function for internal layers of deeponet. Must be TensorFlow useable activation function.

  • out_act (string, default: 'linear' ) –

    Activation function for internal layers of deeponet. Must be TensorFlow useable activation function.

  • constraint (string, default: 'soft' ) –

    Soft or hard constraint for network. Note only soft currently work, for hard, use legacy models.

get_network()

Returns:
  • model

    TensorFlow model.

get_epoch_loss()

Returns:
  • tensor

    Epoch loss after training.

get_domain()

Returns:
  • domain

    Domain deeponet is trained on.

get_sensors()

Returns:
  • tensor

    Sampled sensors deeponet uses

get_epochs()

Returns:
  • int

    Epochs deeponet was trained for.

get_data()

Returns:
  • data

    Data the deeponet uses to train.

get_boundaries()

Returns:
  • boundaries

    Boundaries deeponet was trained on.

get_eqns()

Returns:
  • list

    Equations deeponet was trained for.

train(epochs, opt='adam', meta='false', adapt_pt=None)

Main training function

Parameters:
  • epochs (int) –

    Epochs to train for.

  • opt (string, default: 'adam' ) –

    Optimizer to use.

  • meta (string, default: 'false' ) –

    Whether to meta-learned optimize. Not implemented.

  • adapt_pt (adaptive, default: None ) –

    Adaptive point sampling strategy to use. Not implemented.

trainNoTime(eqns, epochs, opt, meta, adapt_pt)

Main setup for training and training loop which calls trainStep. This is used for a purely spatial problem

Parameters:
  • eqns (list) –

    List of eqns to solve as strings.

  • epochs (int) –

    Epochs to train for.

  • opt (string) –

    Optimizer to use.

  • meta (string) –

    Whether to meta-learned optimize. Not implemented.

  • adapt_pt (adaptive) –

    Adaptive point sampling strategy to use. Not implemented.

trainTime(eqns, epochs, opt, meta, adapt_pt)

Main setup for training and training loop which calls trainStep. This is used for a spatio-temporal problem

Parameters:
  • eqns (list) –

    List of eqns to solve as strings.

  • epochs (int) –

    Epochs to train for.

  • opt (string) –

    Optimizer to use.

  • meta (string) –

    Whether to meta-learned optimize. Not implemented.

  • adapt_pt (adaptive) –

    Adaptive point sampling strategy to use. Not implemented.

Normalize

Bases: Layer

Class which describes a normalize layer for DeepONet. Returns input data normalized to interval [-1, 1].

Periodic

Bases: Layer

Class which describes a Periodic layer for DeepONet. Used in periodic models

mlp_network(inp, n_layers, n_units)

Function which creates simple mlp to be used as basis of trunk and branch nets in DeepONets

Parameters:
  • inp (tensor) –

    Input layer data to mlp

  • n_layers (int) –

    Number of network internal layers

  • n_units (int) –

    Number of units per internal network layer

Returns:
  • out( tensor ) –

    Output data from output layer of network