models

Submodules

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 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.

models.pyg = False[source]
models.dgl_import = False[source]
models.MODEL_REGISTRY[source]
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

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

models.alias_draw(J, q)[source]

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

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