saveplot

Contents

saveplot#

class pinnx.utils.saveplot(loss_history, train_state, issave=True, isplot=True, loss_fname='loss.dat', train_fname='train.dat', test_fname='test.dat', output_dir=None)[source]#

Save/plot the loss history and best trained result.

This function is used to quickly check your results. To better investigate your result, use save_loss_history() and save_best_state().

Parameters:
  • loss_historyLossHistory instance. The first variable returned from Trainer.train().

  • train_stateTrainState instance. The second variable returned from Trainer.train().

  • issave (bool) – Set True (default) to save the loss, training points, and testing points.

  • isplot (bool) – Set True (default) to plot loss, metric, and the predicted solution.

  • loss_fname (string) – Name of the file to save the loss in.

  • train_fname (string) – Name of the file to save the training points in.

  • test_fname (string) – Name of the file to save the testing points in.

  • output_dir (string) – If None, use the current working directory.