Mariam-Elz commited on
Commit
2981c34
·
verified ·
1 Parent(s): 94fd648

Upload model/archs/mlp_head.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. model/archs/mlp_head.py +39 -39
model/archs/mlp_head.py CHANGED
@@ -1,40 +1,40 @@
1
- import torch.nn as nn
2
- import torch.nn.functional as F
3
-
4
-
5
- class SdfMlp(nn.Module):
6
- def __init__(self, input_dim, hidden_dim=512, bias=True):
7
- super().__init__()
8
- self.input_dim = input_dim
9
- self.hidden_dim = hidden_dim
10
-
11
- self.fc1 = nn.Linear(input_dim, hidden_dim, bias=bias)
12
- self.fc2 = nn.Linear(hidden_dim, hidden_dim, bias=bias)
13
- self.fc3 = nn.Linear(hidden_dim, 4, bias=bias)
14
-
15
-
16
- def forward(self, input):
17
- x = F.relu(self.fc1(input))
18
- x = F.relu(self.fc2(x))
19
- out = self.fc3(x)
20
- return out
21
-
22
-
23
- class RgbMlp(nn.Module):
24
- def __init__(self, input_dim, hidden_dim=512, bias=True):
25
- super().__init__()
26
- self.input_dim = input_dim
27
- self.hidden_dim = hidden_dim
28
-
29
- self.fc1 = nn.Linear(input_dim, hidden_dim, bias=bias)
30
- self.fc2 = nn.Linear(hidden_dim, hidden_dim, bias=bias)
31
- self.fc3 = nn.Linear(hidden_dim, 3, bias=bias)
32
-
33
- def forward(self, input):
34
- x = F.relu(self.fc1(input))
35
- x = F.relu(self.fc2(x))
36
- out = self.fc3(x)
37
-
38
- return out
39
-
40
 
 
1
+ import torch.nn as nn
2
+ import torch.nn.functional as F
3
+
4
+
5
+ class SdfMlp(nn.Module):
6
+ def __init__(self, input_dim, hidden_dim=512, bias=True):
7
+ super().__init__()
8
+ self.input_dim = input_dim
9
+ self.hidden_dim = hidden_dim
10
+
11
+ self.fc1 = nn.Linear(input_dim, hidden_dim, bias=bias)
12
+ self.fc2 = nn.Linear(hidden_dim, hidden_dim, bias=bias)
13
+ self.fc3 = nn.Linear(hidden_dim, 4, bias=bias)
14
+
15
+
16
+ def forward(self, input):
17
+ x = F.relu(self.fc1(input))
18
+ x = F.relu(self.fc2(x))
19
+ out = self.fc3(x)
20
+ return out
21
+
22
+
23
+ class RgbMlp(nn.Module):
24
+ def __init__(self, input_dim, hidden_dim=512, bias=True):
25
+ super().__init__()
26
+ self.input_dim = input_dim
27
+ self.hidden_dim = hidden_dim
28
+
29
+ self.fc1 = nn.Linear(input_dim, hidden_dim, bias=bias)
30
+ self.fc2 = nn.Linear(hidden_dim, hidden_dim, bias=bias)
31
+ self.fc3 = nn.Linear(hidden_dim, 3, bias=bias)
32
+
33
+ def forward(self, input):
34
+ x = F.relu(self.fc1(input))
35
+ x = F.relu(self.fc2(x))
36
+ out = self.fc3(x)
37
+
38
+ return out
39
+
40