diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-06-09 22:33:34 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-06-09 22:33:34 +0200 |
commit | 9353a39a18d0542afc177cd134f33f0756820a7d (patch) | |
tree | 2ffbdc31fa9507b11e871cc22e865613ebde74e3 /text_recognizer/networks/cnn.py | |
parent | 0738c29d88e78f8f464d5421e1f5f844ea54c2e7 (diff) |
Remove abstract lightning module
Diffstat (limited to 'text_recognizer/networks/cnn.py')
-rw-r--r-- | text_recognizer/networks/cnn.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/text_recognizer/networks/cnn.py b/text_recognizer/networks/cnn.py deleted file mode 100644 index 5e2a7f4..0000000 --- a/text_recognizer/networks/cnn.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Simple convolutional network.""" -import torch -from torch import nn, Tensor - - -class CNN(nn.Module): - def __init__(self, channels: int, depth: int) -> None: - super().__init__() - self.layers = self._build(channels, depth) - - def _build(self, channels: int, depth: int) -> nn.Sequential: - layers = [] - for i in range(depth): - layers.append( - nn.Conv2d( - in_channels=1 if i == 0 else channels, - out_channels=channels, - kernel_size=3, - stride=2, - ) - ) - layers.append(nn.Mish(inplace=True)) - return nn.Sequential(*layers) - - def forward(self, x: Tensor) -> Tensor: - return self.layers(x) |