fastvpinns.model.model_inverse_domain module

The file model_inverse_domain.py hosts the Neural Network (NN) model and the training loop for variational Physics-Informed Neural Networks (PINNs). This focuses on training variational PINNs for inverse problems where the inverse parameter is constant over the entire domain. The focus is on the model architecture and the training loop, and not on the loss functions.

Author: Thivin Anandh D

Changelog: 22/Sep/2023 - Initial implementation with basic model architecture and training loop

Known issues: None

Dependencies: None specified

class fastvpinns.model.model_inverse_domain.DenseModel_Inverse_Domain(*args, **kwargs)[source]

Bases: Model

A subclass of tf.keras.Model that defines a dense model for an inverse problem.

Parameters:
  • layer_dims (list) – The dimensions of the layers in the model.

  • learning_rate_dict (dict) – A dictionary containing the learning rates.

  • params_dict (dict) – A dictionary containing the parameters of the model.

  • loss_function (function) – The loss function to be used in the model.

  • input_tensors_list (list) – A list of input tensors.

  • orig_factor_matrices (list) – The original factor matrices.

  • force_function_list (list) – A list of force functions.

  • sensor_list (list) – A list of sensors for the inverse problem.

  • inverse_params_dict (dict) – A dictionary containing the parameters for the inverse problem.

  • tensor_dtype (tf.DType) – The data type of the tensors.

  • use_attention (bool) – Whether to use attention mechanism in the model. Defaults to False.

  • activation (str) – The activation function to be used in the model. Defaults to ‘tanh’.

  • hessian (bool) – Whether to use Hessian in the model. Defaults to False.

call(inputs)[source]

The call method for the model.

Parameters:

inputs (tf.Tensor) – The input tensor for the model.

Returns:

The output tensor of the model.

Return type:

tf.Tensor

get_config()[source]

Get the configuration of the model.

Returns:

The configuration of the model.

Return type:

dict

train_step(beta=10, bilinear_params_dict=None)[source]

The train step method for the model.

Parameters:
  • beta (int, optional) – The beta parameter for the training step, defaults to 10.

  • bilinear_params_dict (dict, optional) – The dictionary containing the bilinear parameters, defaults to None.

Returns:

The output of the training step.

Return type:

varies based on implementation