graphorge.gnn_base_model.train.training.write_training_summary_file

write_training_summary_file(device_type, seed, model_directory, load_model_state, n_max_epochs, is_model_in_normalized, is_model_out_normalized, batch_size, is_sampler_shuffle, loss_nature, loss_type, loss_kwargs, opt_algorithm, lr_init, lr_scheduler_type, lr_scheduler_kwargs, n_epochs, dataset_file_path, dataset, best_loss, best_training_epoch, total_time_sec, avg_time_epoch, best_model_parameters=None, torchinfo_summary=None)[source]

Write summary data file for model training process.

Parameters:
  • device_type ({'cpu', 'cuda'}) – Type of device on which torch.Tensor is allocated.

  • seed (int) – Seed used to initialize the random number generators of Python and other libraries (e.g., NumPy, PyTorch) for all devices to preserve reproducibility. Does also set workers seed in PyTorch data loaders.

  • model_directory (str) – Directory where material patch model is stored.

  • load_model_state ({'best', 'last', int, None}) – Load available Graph Neural Network model state from the model directory. Data scalers are also loaded from model initialization file.

  • n_max_epochs (int) – Maximum number of training epochs.

  • is_model_in_normalized (bool, default=False) – If True, then model input features are assumed to be normalized (normalized input data has been seen during model training).

  • is_model_out_normalized (bool, default=False) – If True, then model output features are assumed to be normalized (normalized output data has been seen during model training).

  • batch_size (int) – Number of samples loaded per batch.

  • is_sampler_shuffle (bool) – If True, shuffles data set samples at every epoch.

  • loss_nature (str) – Loss nature.

  • loss_type (str) – Loss function type.

  • loss_kwargs (dict) – Arguments of torch.nn._Loss initializer.

  • opt_algorithm (str) – Optimization algorithm.

  • lr_init (float) – Initial value optimizer learning rate. Constant learning rate value if no learning rate scheduler is specified (lr_scheduler_type=None).

  • lr_scheduler_type (str) – Type of learning rate scheduler.

  • lr_scheduler_kwargs (dict) – Arguments of torch.optim.lr_scheduler.LRScheduler initializer.

  • n_epochs (int) – Number of completed epochs in the training process.

  • dataset_file_path (str) – Graph Neural Network graph data set file path if such file exists. Only used for output purposes.

  • dataset (torch.utils.data.Dataset) – Graph Neural Network graph data set. Each sample corresponds to a torch_geometric.data.Data object describing a homogeneous graph.

  • best_loss (float) – Best loss during training process.

  • best_training_epoch (int) – Training epoch corresponding to best loss during training process.

  • total_time_sec (int) – Total training time in seconds.

  • avg_time_epoch (float) – Average training time per epoch.

  • best_model_parameters (dict) – Model parameters corresponding to best model state.

  • torchinfo_summary (str, default=None) – Torchinfo model architecture summary.