Skip to content

Commit

Permalink
rename in preparation for adding video support (time in older version…
Browse files Browse the repository at this point in the history
… meant the number of medias, not video time)
  • Loading branch information
lucidrains committed Jul 20, 2022
1 parent 26ca8db commit aaa85ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions flamingo_pytorch/flamingo_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ def __init__(
dim_head = 64,
heads = 8,
num_latents = 64,
num_time_embeds = 4,
num_media_embeds = 4,
ff_mult = 4
):
super().__init__()
self.latents = nn.Parameter(torch.randn(num_latents, dim))
self.time_pos_emb = nn.Parameter(torch.randn(num_time_embeds, 1, dim))
self.media_pos_emb = nn.Parameter(torch.randn(num_media_embeds, 1, dim))

self.layers = nn.ModuleList([])
for _ in range(depth):
Expand All @@ -101,7 +101,7 @@ def forward(self, x):
x = rearrange(x, 'b n d -> b 1 n d')

times = x.shape[1]
x = x + self.time_pos_emb[:times]
x = x + self.media_pos_emb[:times]

latents = repeat(self.latents, 'n d -> b m n d', b = x.shape[0], m = x.shape[1])

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'flamingo-pytorch',
packages = find_packages(exclude=[]),
version = '0.0.17',
version = '0.1.0',
license='MIT',
description = 'Flamingo - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit aaa85ff

Please sign in to comment.