torchctr.models package

Submodules

torchctr.models.checker module

class torchctr.models.checker.Checker[source]

Bases: object

Checker for model arguments

static model_check(model_name, kwargs)[source]
classmethod model_param_check(init_model)[source]

torchctr.models.deep_factorization_machine module

class torchctr.models.deep_factorization_machine.DeepFactorizationMachine(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

torchctr.models.factorization_machine module

class torchctr.models.factorization_machine.FactorizationMachine(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

FactorizationMachine Model

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class torchctr.models.factorization_machine.FactorizationMachineLayer(reduce_sum=True)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

torchctr.models.fieldaware_factorization_machine module

class torchctr.models.fieldaware_factorization_machine.FieldAwareFactorizationMachine(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class torchctr.models.fieldaware_factorization_machine.FieldAwareFactorizationMachineLayer(feature_dims, embed_dim)[source]

Bases: torch.nn.modules.module.Module

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

torchctr.models.fieldaware_neural_factorization_machine module

class torchctr.models.fieldaware_neural_factorization_machine.FieldAwareNeuralFactorizationMachine(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

torchctr.models.logistic_regression module

class torchctr.models.logistic_regression.LogisticRegression(feature_dims)[source]

Bases: torch.nn.modules.module.Module

Simple LR with sigmoid or not

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

torchctr.models.neural_factorization_machine module

class torchctr.models.neural_factorization_machine.NeuralFactorizationMachine(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

torchctr.models.wide_and_deep module

class torchctr.models.wide_and_deep.WideAndDeepModel(feature_dims, embed_dim, hidden_dims)[source]

Bases: torch.nn.modules.module.Module

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Module contents

class torchctr.models.LogisticRegression(feature_dims)[source]

Bases: torch.nn.modules.module.Module

Simple LR with sigmoid or not

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class torchctr.models.FactorizationMachine(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

FactorizationMachine Model

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class torchctr.models.FieldAwareFactorizationMachine(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class torchctr.models.WideAndDeepModel(feature_dims, embed_dim, hidden_dims)[source]

Bases: torch.nn.modules.module.Module

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class torchctr.models.DeepFactorizationMachine(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class torchctr.models.NeuralFactorizationMachine(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class torchctr.models.FieldAwareNeuralFactorizationMachine(*args, **kwargs)[source]

Bases: torch.nn.modules.module.Module

forward(x, sigmoid=True)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.