Skip to content

Instantly share code, notes, and snippets.

@alkalait
Created December 1, 2021 15:15
Show Gist options
  • Save alkalait/075470178ad8e75563d33a27c1eb1d62 to your computer and use it in GitHub Desktop.
Save alkalait/075470178ad8e75563d33a27c1eb1d62 to your computer and use it in GitHub Desktop.
Minimal ways to learn with multiple revisits
# batch, time, bands, height, width
B, T, C, H, W = x.shape
C_o = 32 # hyperparam
F = lambda i, o, g=1:
nn.Conv2d(in_channels=i,
out_channels=o,
kernel_size=3,
padding='same',
groups=g)
# revisit-invariant / shared:
f = F(C, Co)
x = f(x.view(B*T, C, H, W))
# revisit-specific / revisit-wise:
f = F(T*C, T*Co, T)
x = f(x.view(B, T*C, H, W))
# revisit-connected:
f = F(C, Co)
x = f(x)
# in any case
x = x.view(B, T, C_o, H, W)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment