cogdl.models

Package Contents

Classes

BaseModel

Functions

register_model(name)

New model types can be added to cogdl with the register_model()

alias_setup(probs)

Compute utility lists for non-uniform sampling from discrete distributions.

alias_draw(J, q)

Draw sample from a non-uniform discrete distribution using alias sampling.

build_model(args)

class cogdl.models.BaseModel[source]

Bases: torch.nn.Module

static add_args(parser)

Add model-specific arguments to the parser.

abstract classmethod build_model_from_args(cls, args)

Build a new model instance.

_forward_unimplemented(self, *input: Any)None
static get_trainer(taskType: Any, args: Any)Optional[Type[BaseTrainer]]
cogdl.models.pyg = False[source]
cogdl.models.dgl_import = False[source]
cogdl.models.MODEL_REGISTRY[source]
cogdl.models.register_model(name)[source]

New model types can be added to cogdl with the register_model() function decorator.

For example:

@register_model('gat')
class GAT(BaseModel):
    (...)
Args:

name (str): the name of the model

cogdl.models.alias_setup(probs)[source]

Compute utility lists for non-uniform sampling from discrete distributions. Refer to https://hips.seas.harvard.edu/blog/2013/03/03/the-alias-method-efficient-sampling-with-many-discrete-outcomes/ for details

cogdl.models.alias_draw(J, q)[source]

Draw sample from a non-uniform discrete distribution using alias sampling.

cogdl.models.model_name[source]
cogdl.models.build_model(args)[source]