fastvpinns.utils.plot_utils module

The file plot_utils.py contains the utility functions for plotting the loss functions and the predicted inverse parameters

Author: Thivin Anandh D

Date: 02/Nov/2023

Changelog: 02/Nov/2023 - file is created; and added functions to plot the loss functions and the predicted inverse parameters

Known issues: None

fastvpinns.utils.plot_utils.plot_array(array, output_path, filename, title, x_label='Epochs', y_label='Loss')[source]

This function will plot the loss function.

Parameters:
  • array (list) – list of loss values

  • output_path (str) – path to save the plot

  • filename (str) – filename to save the plot

  • title (str) – title of the plot

  • x_label (str, optional) – x-axis label, defaults to “Epochs”

  • y_label (str, optional) – y-axis label, defaults to “Loss”

Returns:

None

Return type:

None

fastvpinns.utils.plot_utils.plot_contour(x, y, z, output_path, filename, title)[source]

This function will plot the contour plot.

Parameters:
  • x (numpy.ndarray) – x values

  • y (numpy.ndarray) – y values

  • z (numpy.ndarray) – z values

  • output_path (str) – path to save the plot

  • filename (str) – filename to save the plot

  • title (str) – title of the plot

Returns:

None

Return type:

None

fastvpinns.utils.plot_utils.plot_inverse_param_function(inverse_predicted, inverse_param_name, actual_value, output_path, file_prefix)[source]

This function will plot the predicted inverse parameter.

Parameters:
  • inverse_predicted (list) – list of predicted inverse parameter values

  • inverse_param_name (str) – name of the inverse parameter

  • actual_value (float) – actual value of the inverse parameter

  • output_path (str) – path to save the plot

  • file_prefix (str) – prefix for the filename

Returns:

None

Return type:

None

fastvpinns.utils.plot_utils.plot_inverse_test_loss_function(loss_function, output_path)[source]

This function will plot the test loss function of the inverse parameter.

Parameters:
  • loss_function (list) – list of loss values

  • output_path (str) – path to save the plot

Returns:

None

Return type:

None

fastvpinns.utils.plot_utils.plot_loss_function(loss_function, output_path)[source]

This function will plot the loss function.

Parameters:
  • loss_function (list) – list of loss values

  • output_path (str) – path to save the plot

Returns:

None

Return type:

None

fastvpinns.utils.plot_utils.plot_multiple_loss_function(loss_function_list, output_path, filename, legend_labels, y_label, title, x_label='Epochs')[source]

This function will plot the loss function in log scale for multiple parameters.

Parameters:
  • loss_function_list (list) – list of loss values for multiple parameters

  • output_path (str) – path to save the plot

  • filename (str) – filename to save the plot

  • legend_labels (list) – list of legend labels

  • y_label (str) – y-axis label

  • title (str) – title of the plot

  • x_label (str, optional) – x-axis label, defaults to “Epochs”

Returns:

None

Return type:

None

fastvpinns.utils.plot_utils.plot_test_loss_function(loss_function, output_path, fileprefix='')[source]

This function will plot the test loss function.

Parameters:
  • loss_function (list) – list of loss values

  • output_path (str) – path to save the plot

  • fileprefix (str, optional) – prefix for the filename, defaults to “”

Returns:

None

Return type:

None

fastvpinns.utils.plot_utils.plot_test_time_loss_function(time_array, loss_function, output_path)[source]

This function will plot the test loss as a function of time in seconds.

Parameters:
  • time_array (numpy.ndarray) – array of time values

  • loss_function (list) – list of loss values

  • output_path (str) – path to save the plot

Returns:

None

Return type:

None