tasks¶
Base Task¶
-
class
cogdl.tasks.base_task.
BaseTask
(args)[source]¶ Bases:
abc.ABC
-
class
cogdl.tasks.base_task.
LoadFrom
[source]¶ Bases:
abc.ABCMeta
Node Classification¶
-
class
cogdl.tasks.node_classification.
NodeClassification
(args, dataset=None, model: Optional[cogdl.models.supervised_model.SupervisedHomogeneousNodeClassificationModel] = None)[source]¶ Bases:
cogdl.tasks.base_task.BaseTask
Node classification task.
Unsupervised Node Classification¶
-
class
cogdl.tasks.unsupervised_node_classification.
TopKRanker
(estimator, *, n_jobs=None)[source]¶ Bases:
sklearn.multiclass.OneVsRestClassifier
-
class
cogdl.tasks.unsupervised_node_classification.
UnsupervisedNodeClassification
(args, dataset=None, model=None)[source]¶ Bases:
cogdl.tasks.base_task.BaseTask
Node classification task.
Heterogeneous Node Classification¶
-
class
cogdl.tasks.heterogeneous_node_classification.
HeterogeneousNodeClassification
(args, dataset=None, model=None)[source]¶ Bases:
cogdl.tasks.base_task.BaseTask
Heterogeneous Node classification task.
Multiplex Node Classification¶
Link Prediction¶
-
class
cogdl.tasks.link_prediction.
GNNHomoLinkPrediction
(args, dataset=None, model=None)[source]¶ Bases:
torch.nn.modules.module.Module
-
train
()[source]¶ Sets the module in training mode.
This has any effect only on certain modules. See documentations of particular modules for details of their behaviors in training/evaluation mode, if they are affected, e.g.
Dropout
,BatchNorm
, etc.- Args:
- mode (bool): whether to set training mode (
True
) or evaluation - mode (
False
). Default:True
.
- mode (bool): whether to set training mode (
- Returns:
- Module: self
-
-
class
cogdl.tasks.link_prediction.
HomoLinkPrediction
(args, dataset=None, model=None)[source]¶ Bases:
torch.nn.modules.module.Module
-
train
()[source]¶ Sets the module in training mode.
This has any effect only on certain modules. See documentations of particular modules for details of their behaviors in training/evaluation mode, if they are affected, e.g.
Dropout
,BatchNorm
, etc.- Args:
- mode (bool): whether to set training mode (
True
) or evaluation - mode (
False
). Default:True
.
- mode (bool): whether to set training mode (
- Returns:
- Module: self
-
-
class
cogdl.tasks.link_prediction.
KGLinkPrediction
(args, dataset=None, model=None)[source]¶ Bases:
torch.nn.modules.module.Module
-
train
()[source]¶ Sets the module in training mode.
This has any effect only on certain modules. See documentations of particular modules for details of their behaviors in training/evaluation mode, if they are affected, e.g.
Dropout
,BatchNorm
, etc.- Args:
- mode (bool): whether to set training mode (
True
) or evaluation - mode (
False
). Default:True
.
- mode (bool): whether to set training mode (
- Returns:
- Module: self
-
-
class
cogdl.tasks.link_prediction.
TripleLinkPrediction
(args, dataset=None, model=None)[source]¶ Bases:
torch.nn.modules.module.Module
Training process borrowed from KnowledgeGraphEmbedding<https://github.com/DeepGraphLearning/KnowledgeGraphEmbedding>
-
train
()[source]¶ Sets the module in training mode.
This has any effect only on certain modules. See documentations of particular modules for details of their behaviors in training/evaluation mode, if they are affected, e.g.
Dropout
,BatchNorm
, etc.- Args:
- mode (bool): whether to set training mode (
True
) or evaluation - mode (
False
). Default:True
.
- mode (bool): whether to set training mode (
- Returns:
- Module: self
-
Multiplex Link Prediction¶
-
class
cogdl.tasks.multiplex_link_prediction.
MultiplexLinkPrediction
(args, dataset=None, model=None)[source]¶
Graph Classification¶
-
class
cogdl.tasks.graph_classification.
GraphClassification
(args, dataset=None, model=None)[source]¶ Bases:
cogdl.tasks.base_task.BaseTask
Superiviced graph classification task.
Unsupervised Graph Classification¶
-
class
cogdl.tasks.unsupervised_graph_classification.
UnsupervisedGraphClassification
(args, dataset=None, model=None)[source]¶ Bases:
cogdl.tasks.base_task.BaseTask
Unsupervised graph classification
Attributed Graph Clustering¶
-
class
cogdl.tasks.attributed_graph_clustering.
AttributedGraphClustering
(args, dataset=None, _=None)[source]¶ Bases:
cogdl.tasks.base_task.BaseTask
Attributed graph clustring task.
Similarity Search¶
Pretrain¶
Task Module¶
-
cogdl.tasks.
register_task
(name)[source]¶ New task types can be added to cogdl with the
register_task()
function decorator.For example:
@register_task('node_classification') class NodeClassification(BaseTask): (...)
- Args:
- name (str): the name of the task