Logo
1.0.0

Get Started

  • Install and Setup
  • Tutorial
  • Load Custom Scenarios

Datasets

  • Datasets for Node-Level Problems
  • Datasets for Link-Level Problems
  • Datasets for Graph-Level Problems

Scenarios

  • Common framework
  • Node-level problems
  • Link-level problems
    • LCScenarioLoader
      • LCScenarioLoader._get_eval_result_inner()
      • LCScenarioLoader._init_continual_scenario()
      • LCScenarioLoader._update_accumulated_dataset()
      • LCScenarioLoader._update_target_dataset()
      • LCScenarioLoader.get_accum_eval_result()
      • LCScenarioLoader.get_current_dataset_for_export()
      • LCScenarioLoader.get_simple_eval_result()
      • LCScenarioLoader.next_task()
    • LPScenarioLoader
      • LPScenarioLoader._get_eval_result_inner()
      • LPScenarioLoader._init_continual_scenario()
      • LPScenarioLoader._update_accumulated_dataset()
      • LPScenarioLoader._update_target_dataset()
      • LPScenarioLoader.get_accum_eval_result()
      • LPScenarioLoader.get_current_dataset_for_export()
      • LPScenarioLoader.get_simple_eval_result()
      • LPScenarioLoader.next_task()
  • Graph-level problems

Trainer

  • Common framework
  • Node-level problems
  • Link-level problems
  • Graph-level problems

Continual Learning Methods

  • Bare Model
  • LwF
  • EWC
  • MAS
  • GEM
  • TWP
  • ER-GNN
  • ContinualGNN
  • PackNet
  • Piggyback
  • HAT

Evaluator

  • Basic Performance Metrics
  • Metrics for CL

Utils

  • AdaptiveLinear
BeGin
  • Link-level problems
  • View page source

Link-level problems

class LCScenarioLoader(dataset_name, save_path, num_tasks, incr_type, metric, **kwargs)[source]

The sceanario loader for link classification.

Usage example:

>>> scenario = LCScenarioLoader(dataset_name="bitcoin", num_tasks=3, metric="accuracy",
...                             save_path="./data", incr_type="task", task_shuffle=True)
>>> scenario = LCScenarioLoader(dataset_name="bitcoin", num_tasks=7, metric="aucroc",
...                             save_path="./data", incr_type="time")

Bases: BaseScenarioLoader

_get_eval_result_inner(preds, target_split)[source]

The inner function of get_eval_result.

Parameters:
  • preds (torch.Tensor) – predicted output of the current model

  • target_split (str) – target split to measure the performance (spec., ‘val’ or ‘test’)

_init_continual_scenario()[source]

Load the entire dataset and initialize the setting of graph continual learning according the incremental setting.

_update_accumulated_dataset()[source]

Update the graph dataset the joint model uses. According to the incr_type, the information updated is different.

Note

The joint model can process all of training data in previous tasks including the current task.

_update_target_dataset()[source]

Update the graph dataset the implemented model uses in the current task. According to the incr_type, the information updated is different.

Note

The implemented model can only process the training data in the current task.

get_accum_eval_result(preds, target_split='test')[source]

Compute performance on the accumulated dataset for the given target split. It can be used to compute train/val performance during training.

Parameters:
  • preds (torch.Tensor) – predicted output of the current model

  • target_split (str) – target split to measure the performance (spec., ‘val’ or ‘test’)

get_current_dataset_for_export(_global=False)[source]
Returns:

The graph dataset the implemented model uses in the current task

get_simple_eval_result(curr_batch_preds, curr_batch_gts)[source]

Compute performance for the given batch when we ignore task configuration. It can be used to compute train/val performance during training.

Parameters:
  • curr_batch_preds (torch.Tensor) – predicted output of the current model

  • curr_batch_gts (torch.Tensor) – ground-truth labels

next_task(preds=torch.empty)[source]

Update graph datasets used in graph continual learning. Specifically, the target denotes a dataset the implemented model uses and the accumulated denotes a dataset the joint model uses.

Parameters:

preds (torch.Tensor) – Predicted output of the models

class LPScenarioLoader(dataset_name, save_path, num_tasks, incr_type, metric, **kwargs)[source]

The sceanario loader for link prediction.

Usage example:

>>> scenario = LPScenarioLoader(dataset_name="ogbl-collab", num_tasks=3, metric="hits@50",
...                             save_path="./data", incr_type="time", task_shuffle=True)

Bases: BaseScenarioLoader

_get_eval_result_inner(preds, target_split)[source]

The inner function of get_eval_result.

Parameters:
  • preds (torch.Tensor) – predicted output of the current model

  • target_split (str) – target split to measure the performance (spec., ‘val’ or ‘test’)

_init_continual_scenario()[source]

Load the entire dataset and initialize the setting of graph continual learning according the incremental setting.

_update_accumulated_dataset()[source]

Update the graph dataset the joint model uses. According to the incr_type, the information updated is different.

Note

The joint model can process all of training data in previous tasks including the current task.

_update_target_dataset()[source]

Update the graph dataset the implemented model uses in the current task. According to the incr_type, the information updated is different.

Note

The implemented model can only process the training data in the current task.

get_accum_eval_result(preds, target_split='test')[source]

Compute performance on the accumulated dataset for the given target split. It can be used to compute train/val performance during training.

Parameters:
  • preds (torch.Tensor) – predicted output of the current model

  • target_split (str) – target split to measure the performance (spec., ‘val’ or ‘test’)

get_current_dataset_for_export(_global=False)[source]
Returns:

The graph dataset the implemented model uses in the current task

get_simple_eval_result(curr_batch_preds, curr_batch_gts)[source]

Compute performance for the given batch when we ignore task configuration. It can be used to compute train/val performance during training.

Parameters:
  • curr_batch_preds (torch.Tensor) – predicted output of the current model

  • curr_batch_gts (torch.Tensor) – ground-truth labels

next_task(preds=torch.empty)[source]

Update graph datasets used in graph continual learning. Specifically, the target denotes a dataset the implemented model uses and the accumulated denotes a dataset the joint model uses.

Parameters:

preds (torch.Tensor) – Predicted output of the models

Previous Next

© Copyright Anonymous.

Built with Sphinx using a theme provided by Read the Docs.