jactorch.nn.neural_logic.layer#

Classes

Class NeuralLogicLayer

class NeuralLogicLayer[source]#

Bases: Module

__init__(breadth, input_dims, output_dims, logic_model, logic_hidden_dim, exclude_self=True, residual=False, activation='sigmoid', use_exists=True, min_val=0., max_val=1.)[source]#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(inputs, inputs_length_or_mask=None)[source]#

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

classmethod from_args(input_dims, output_dims, args, prefix=None, **kwargs)[source]#
classmethod make_prog_block_parser(parser, defaults, prefix=None)[source]#

Class NeuralLogicMachine

class NeuralLogicMachine[source]#

Bases: Module

__init__(depth, breadth, input_dims, output_dims, logic_model, logic_hidden_dim, exclude_self=True, residual=False, io_residual=False, connections=None, activation='sigmoid', min_val=0., max_val=1., use_exists=True)[source]#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(inputs, inputs_length_or_mask=None, depth=None)[source]#

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

classmethod from_args(input_dims, output_dims, args, prefix=None, **kwargs)[source]#
classmethod make_prog_block_parser(parser, defaults, prefix=None)[source]#