Perceiver IO Decoder
- class vformer.decoder.perceiver_io.PerceiverIODecoder(dim=32, latent_dim=512, queries_dim=32, num_cross_heads=1, cross_head_dim=64, logits_dim=None, decoder_ff=False)[source]
Implementation of the Perceiver IO Decoder
- Parameters
dim (int) – Size of sequence to be encoded
latent_dim (int) – Dimension of latent array
queries_dim (int) – Dimension of queries array
num_latents (int) – Number of latent arrays
num_cross_heads (int) – Number of heads for cross attention
cross_head_dim (int) – Dimension of cross attention head
logits_dim (int, optional) – Dimension of output logits
decoder_ff (bool) – Whether to include a feed forward layer for the decoder attention block
- forward(x, mask=None, queries=None)[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.