diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-11-21 21:34:53 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-11-21 21:34:53 +0100 |
commit | b44de0e11281c723ec426f8bec8ca0897ecfe3ff (patch) | |
tree | 998841a3a681d3dedfbe8470c1b8544b4dcbe7a2 /text_recognizer/networks/vqvae/resize.py | |
parent | 3b2fb0fd977a6aff4dcf88e1a0f99faac51e05b1 (diff) |
Remove VQVAE stuff, did not work...
Diffstat (limited to 'text_recognizer/networks/vqvae/resize.py')
-rw-r--r-- | text_recognizer/networks/vqvae/resize.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/text_recognizer/networks/vqvae/resize.py b/text_recognizer/networks/vqvae/resize.py deleted file mode 100644 index 8d67d02..0000000 --- a/text_recognizer/networks/vqvae/resize.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Up and down-sample with linear interpolation.""" -from torch import nn, Tensor -import torch.nn.functional as F - - -class Upsample(nn.Module): - """Upsamples by a factor 2.""" - - def forward(self, x: Tensor) -> Tensor: - """Applies upsampling.""" - return F.interpolate(x, scale_factor=2.0, mode="nearest") - - -class Downsample(nn.Module): - """Downsampling by a factor 2.""" - - def forward(self, x: Tensor) -> Tensor: - """Applies downsampling.""" - return F.avg_pool2d(x, kernel_size=2, stride=2) |