Skip to content

Learnable blending function for video transformers that operates over patch embeddings across the temporal dimension of the latent space.

License

Notifications You must be signed in to change notification settings

GabPrato/PatchBlender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

PatchBlender

Implementation of the PatchBlender layer introduced in https://arxiv.org/abs/2211.14449

Instructions

This torch module can be used in various contexts; in the paper, we use it between the layer normalization and the attention layer.

# Transformer layer example
def forward(self, x):
    residual = x
    x = self.layer_norm1(x)
    x = self.patch_blender(x)
    x = self.attention_layer(x)
    x += residual

    residual = x
    x = self.layer_norm2(x)
    x = self.feed_forward(x)
    x += residual

    return x

About

Learnable blending function for video transformers that operates over patch embeddings across the temporal dimension of the latent space.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages