# Telegram Bot
# telegram_config_file: telegram_config.yml

# Dataset and Splits
data_root: DATA
dataset_class: pydgn.data.dataset.TUDatasetInterface
dataset_name:  NCI1
data_splits_file:  DATA_SPLITS/CHEMICAL/NCI1/NCI1_outer10_inner1.splits


# Hardware
device:  cuda
max_cpus:  64
max_gpus: 3
gpus_per_task:  0.25  # this multiplies GPU parallelism by 4, so be sure to provide enough CPUs


# Data Loading
dataset_getter: pydgn.data.provider.DataProvider
data_loader:
  class_name: torch_geometric.loader.DataLoader
  args:
    num_workers : 1
    pin_memory: True


# Reproducibility
seed: 42


# Experiment
result_folder: GSPN_RESULTS/SUPERVISED
exp_name: supervised_gspn_classification_chemical
experiment: pydgn.experiment.supervised_task.SupervisedTask
higher_results_are_better: True
evaluate_every: 1
final_training_runs: 3

grid:
  supervised_config:
    model: sup_model.SupGSPN
    checkpoint: True
    shuffle: True
    batch_size: 32
    epochs: 500

    # Model specific arguments #

    convolution_class: model.GSPNBaseConv
    emission_class: model.GSPNCategoricalEmission

    num_mixtures:
      - 20
      - 40

    num_graph_mixtures:
      - 32
      - 128

    num_hidden_neurons:
      - 0  # not used at the moment

    num_layers:
      - 5
      - 10
      - 20

    global_readout:
      - sum
      - mean

    # ------------------------ #

    # Optimizer
    optimizer:
      - class_name: pydgn.training.callback.optimizer.Optimizer
        args:
          optimizer_class_name: torch.optim.Adam
          lr: 0.01
          accumulate_gradients: False  # do/do not accumulate gradient across mini-batches

    # Scheduler
    scheduler: null

    # Loss metric
    loss:
      - pydgn.training.callback.metric.MulticlassClassification
#      - class_name: pydgn.training.callback.metric.AdditiveLoss
#        args:
#          classification: pydgn.training.callback.metric.MulticlassClassification
#          data_likelihood: metric.GSPNNodeLogLikelihood

    # Score metric
    scorer:
      - class_name: pydgn.training.callback.metric.MultiScore
        args:
          main_scorer: pydgn.training.callback.metric.MulticlassAccuracy
          data_likelihood: metric.GSPNNodeLogLikelihood

    # Readout (optional)
    readout: null

    # Training engine
    engine: pydgn.training.engine.TrainingEngine

    # Gradient clipper (optional)
    gradient_clipper: null

    # Early stopper
    early_stopper:
      - class_name:
          - pydgn.training.callback.early_stopping.PatienceEarlyStopper
        args:
          patience:
            - 50
          monitor: validation_main_score
          mode: max
          checkpoint: True

    # Plotter of metrics
    plotter: pydgn.training.callback.plotter.Plotter