Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#381 Feature/sg 000 connect to lab

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/sg-000_connect_to_lab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  1. '''
  2. LeNet in PyTorch.
  3. https://yann.lecun.com/exdb/lenet/
  4. '''
  5. import torch.nn as nn
  6. import torch.nn.functional as F
  7. from super_gradients.training.models.sg_module import SgModule
  8. class LeNet(SgModule):
  9. def __init__(self):
  10. super(LeNet, self).__init__()
  11. self.conv1 = nn.Conv2d(3, 6, 5)
  12. self.conv2 = nn.Conv2d(6, 16, 5)
  13. self.fc1 = nn.Linear(16 * 5 * 5, 120)
  14. self.fc2 = nn.Linear(120, 84)
  15. self.fc3 = nn.Linear(84, 10)
  16. def forward(self, x):
  17. out = F.relu(self.conv1(x))
  18. out = F.max_pool2d(out, 2)
  19. out = F.relu(self.conv2(out))
  20. out = F.max_pool2d(out, 2)
  21. out = out.view(out.size(0), -1)
  22. out = F.relu(self.fc1(out))
  23. out = F.relu(self.fc2(out))
  24. out = self.fc3(out)
  25. return out
Discard
Tip!

Press p or to see the previous file or, n or to see the next file