sketchgraphs_models.graph.model.numerical_features.NumericalFeatureReadout

class sketchgraphs_models.graph.model.numerical_features.NumericalFeatureReadout(initial_input, feature_encoders, feature_decoders, sequence_model)

Module for numerical feature readout.

This module is responsible for producing numerical edge features from the edge label and computed embeddings.

__init__(initial_input, feature_encoders, feature_decoders, sequence_model)

Creates a new edge feature readout model.

Parameters
  • initial_input (torch.nn.Module) – A module which creates the embedding for the first input slot based on the passed in data. It is called with all remaining arguments to the forward method.

  • feature_encoders (torch.nn.Module) – A module which encodes the features from the edge for feeding in to network. It is called with an integer tensor of size [batch, num_features].

  • feature_decoders (torch.nn.Module) – A module which decodes sequence embeddings into an array of logits.

  • sequence_model (torch.nn.Module) – The main computational module for this instance, transforms a sequence of embedding into another sequence of embedding.

forward(input_features, *args)

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.