Mehriddin1997 commited on
Commit
3230f9d
·
verified ·
1 Parent(s): 6cf3ff0

Upload 2 files

Browse files
Files changed (2) hide show
  1. letter_cnn_state_dict.pt +3 -0
  2. model.py +24 -0
letter_cnn_state_dict.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23f1ea7ccf68d5c88acbf74d4c4560c534691e4c4dc51f523893b1d7e9d20953
3
+ size 839825
model.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import torch.nn as nn
3
+
4
+ class LetterCNN(nn.Module):
5
+ def __init__(self):
6
+ super().__init__()
7
+ self.conv = nn.Sequential(
8
+ nn.Conv2d(1, 16, 3, padding=1),
9
+ nn.ReLU(),
10
+ nn.MaxPool2d(2),
11
+ nn.Conv2d(16, 32, 3, padding=1),
12
+ nn.ReLU(),
13
+ nn.MaxPool2d(2),
14
+ )
15
+ self.fc = nn.Sequential(
16
+ nn.Linear(32*7*7, 128),
17
+ nn.ReLU(),
18
+ nn.Linear(128, 26)
19
+ )
20
+
21
+ def forward(self, x):
22
+ x = self.conv(x)
23
+ x = x.view(-1, 32*7*7)
24
+ return self.fc(x)