|
30 | 30 |
|
31 | 31 |
|
32 | 32 | random.seed(0) |
33 | | -dtype = torch.FloatTensor |
| 33 | +dtype = torch.cuda.FloatTensor |
34 | 34 |
|
35 | 35 | class modelnet40_dataset(Dataset): |
36 | 36 |
|
@@ -68,14 +68,6 @@ def __init__(self): |
68 | 68 | Dense( 64, 40, with_bn = False, activation = None) |
69 | 69 | ) |
70 | 70 |
|
71 | | - self.test_fcn = nn.Linear(1024*3, 40) |
72 | | - ''' |
73 | | - def forward(self, x): |
74 | | - x = x[0] |
75 | | - x = x.view(x.size(0), -1) |
76 | | - logits = self.test_fcn(x) |
77 | | - return logits |
78 | | - ''' |
79 | 71 | def forward(self, x): |
80 | 72 | x = self.pcnn1(x) |
81 | 73 | if False: |
@@ -136,9 +128,9 @@ def forward(self, x): |
136 | 128 | scaling_range = [0.05, 0.05, 0.05, 'g'] |
137 | 129 | scaling_range_val = [0, 0, 0, 'u'] |
138 | 130 |
|
139 | | -print("before model") |
| 131 | +print("------Building model-------") |
140 | 132 | model = Classifier().cuda() |
141 | | -print("after model") |
| 133 | +print("------Successfully Built model-------") |
142 | 134 |
|
143 | 135 | decay_steps = FLAGS.decay_step |
144 | 136 | decay_rate = FLAGS.decay_rate |
@@ -212,9 +204,9 @@ def forward(self, x): |
212 | 204 |
|
213 | 205 | out = model((P_sampled, P_sampled)) |
214 | 206 | loss = loss_fn(out, label) |
215 | | - #print("epoch: "+str(epoch) + " loss: "+str(loss)) |
216 | 207 | loss.backward() |
217 | 208 | optimizer.step() |
| 209 | + print("epoch: "+str(epoch) + " loss: "+str(loss.data[0])) |
218 | 210 | if global_step % 25 == 0: |
219 | 211 | loss_v = loss.data[0] |
220 | 212 | print("Loss:", loss_v) |
|
0 commit comments