summaryrefslogtreecommitdiff
path: root/models/auto_encoder.py
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2020-12-31 21:00:01 +0800
committerJordan Gong <jordan.gong@protonmail.com>2020-12-31 21:00:01 +0800
commit86421e899c87976d8559795979415e3fae2bd7ed (patch)
treec4bfa828da64cc71b43ed12d3fd78be8a8930181 /models/auto_encoder.py
parent57275a210b93f9ffd30a53e22c3c28f49f228d14 (diff)
Implement some parts of RGB-GaitPart wrapper
1. Triplet loss function and weight init function haven't been implement yet 2. Tuplize features returned by auto-encoder for later unpack 3. Correct comment error in auto-encoder 4. Swap batch_size dim and time dim in HPM and PartNet in case of redundant transpose 5. Find backbone problems in HPM and disable it temporarily 6. Make feature structure by HPM consistent to that by PartNet 7. Fix average pooling dimension issue and incorrect view change in HP
Diffstat (limited to 'models/auto_encoder.py')
-rw-r--r--models/auto_encoder.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/auto_encoder.py b/models/auto_encoder.py
index de38572..c84061c 100644
--- a/models/auto_encoder.py
+++ b/models/auto_encoder.py
@@ -129,7 +129,7 @@ class AutoEncoder(nn.Module):
self.xent_loss = nn.CrossEntropyLoss()
def forward(self, x_c1_t1, x_c1_t2, x_c2_t2, y):
- # t2 is random time step
+ # t1 is random time step
(f_a_c1_t1, f_c_c1_t1, _) = self.encoder(x_c1_t1)
(_, f_c_c1_t2, f_p_c1_t2) = self.encoder(x_c1_t2)
(_, f_c_c2_t2, f_p_c2_t2) = self.encoder(x_c2_t2)
@@ -142,5 +142,5 @@ class AutoEncoder(nn.Module):
+ self.mse_loss(f_c_c1_t2, f_c_c2_t2)
+ self.xent_loss(y, y_))
- return (f_c_c1_t2, f_p_c1_t2, f_p_c2_t2,
+ return ((f_c_c1_t2, f_p_c1_t2, f_p_c2_t2),
xrecon_loss_t2, cano_cons_loss_t2)