terminator.models.layers.gvp.GVP

class terminator.models.layers.gvp.GVP(in_dims, out_dims, h_dim=None, activations=(<function relu>, <built-in method sigmoid of type object>), vector_gate=False)[source]

Bases: Module

Geometric Vector Perceptron. See manuscript and README.md for more details.

Parameters:
  • in_dims – tuple (n_scalar, n_vector)

  • out_dims – tuple (n_scalar, n_vector)

  • h_dim – intermediate number of vector channels, optional

  • activations – tuple of functions (scalar_act, vector_act)

  • vector_gate – whether to use vector gating. (vector_act will be used as sigma^+ in vector gating if True)

__init__(in_dims, out_dims, h_dim=None, activations=(<function relu>, <built-in method sigmoid of type object>), vector_gate=False)[source]

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

Methods

__init__(in_dims, out_dims[, h_dim, ...])

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

forward(x)

param x:

tuple (s, V) of torch.Tensor,

Attributes

T_destination

alias of TypeVar('T_destination', bound=Mapping[str, Tensor])

dump_patches

This allows better BC support for load_state_dict().

forward(x)[source]
Parameters:

x – tuple (s, V) of torch.Tensor, or (if vectors_in is 0), a single torch.Tensor

Returns:

tuple (s, V) of torch.Tensor, or (if vectors_out is 0), a single torch.Tensor