-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmodel.py
More file actions
39 lines (31 loc) · 1002 Bytes
/
Copy pathmodel.py
File metadata and controls
39 lines (31 loc) · 1002 Bytes
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
30
31
32
33
34
35
36
37
38
39
import torch.nn as nn
class DepthNetModel(nn.Module):
def __init__(self):
super(DepthNetModel, self).__init__()
self.layer = nn.Sequential(
nn.Conv2d(200, 100, 7, stride=1),
nn.ReLU(),
nn.Conv2d(100, 100, 5, stride=1),
nn.ReLU(),
nn.Conv2d(100, 50, 3, stride=1),
nn.ReLU(),
nn.Conv2d(50, 1, 1, stride=1),
)
def forward(self, features):
out = self.layer(features)
return out
class ColorNetModel(nn.Module):
def __init__(self):
super(ColorNetModel, self).__init__()
self.layer = nn.Sequential(
nn.Conv2d(15, 100, 7, stride=1),
nn.ReLU(),
nn.Conv2d(100, 100, 5, stride=1),
nn.ReLU(),
nn.Conv2d(100, 50, 3, stride=1),
nn.ReLU(),
nn.Conv2d(50, 3, 1, stride=1),
)
def forward(self, features):
out = self.layer(features)
return out