sketchgraphs_models.graph.model.numerical_features

This module contains the components of the graph model that are concerned with handling numerical features associated with edges and nodes.

Classes

NumericalFeatureDecoder(feature_dims, …)

Module for decoding numerical feature embeddings to logits.

NumericalFeatureEncoding(feature_dims, …)

Encode an array of numerical features.

NumericalFeatureReadout(initial_input, …)

Module for numerical feature readout.

NumericalFeaturesEmbedding(embedding_dim)

Transform a sequence of numerical feature vectors into a single vector.

Functions

sketchgraphs_models.graph.model.numerical_features.edge_decoder_initial_input(embedding_size)

Initial input function for edge readouts.

sketchgraphs_models.graph.model.numerical_features.entity_decoder_initial_input(embedding_size)

Initial input function for entity readouts.

sketchgraphs_models.graph.model.numerical_features.make_embedding_and_readout(embedding_size: int, feature_dimensions, initial_input_factory)

Creates feature embedding and readout networks for the given features.

Parameters
  • embedding_size (int) – Dimension of the embeddings to use.

  • feature_dimensions (dict) – Dictionary whose values are lists of integers corresponding to the number of outcomes for each feature.

  • initial_input_factory (int -> torch.nn.Module) – A function which returns a module responsible for transforming the inputs of the readout into initial embeddings for the internal sequence model.

Returns

  • feature_embeddings (dict) – A dictionary containing the feature embedding modules.

  • feature_readouts (dict) – A dictionary containing the feature readout modules.