transition

This commit is contained in:
Si11ium
2021-02-01 10:23:22 +01:00
parent f6156c6cde
commit 010176e80b
18 changed files with 133 additions and 61 deletions

View File

@ -150,23 +150,6 @@ class F_x(ShapeMixin, nn.Module):
return x
class ResidualBlock(nn.Module):
def __init__(self, fn):
super().__init__()
self.fn = fn
def forward(self, x, **kwargs):
return self.fn(x, **kwargs) + x
class PreNorm(nn.Module):
def __init__(self, dim, fn):
super().__init__()
self.norm = nn.LayerNorm(dim)
self.fn = fn
def forward(self, x, **kwargs):
return self.fn(self.norm(x), **kwargs)
class SlidingWindow(ShapeMixin, nn.Module):
def __init__(self, in_shape, kernel, stride=1, padding=0, keepdim=False):
super(SlidingWindow, self).__init__()