thuml / Anomaly-Transformer

About Code release for "Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy" (ICLR 2022 Spotlight), https://openreview.net/forum?id=LzQQ89U1qm_
MIT License
763 stars 202 forks source link

关于 Minimax Strategy 的顺序 #17

Closed ForestsKing closed 2 years ago

ForestsKing commented 2 years ago

关于Minimax Strategy ,我理解的您论文中的表述是需要先 minimize 使 P 靠近 S,再 maximize 使 S 远离 P。但是注意到您代码中似乎是先 maximize 再 minimize。想请问下 Minimax Strategy 的顺序对模型训练有影响吗?谢谢!

loss1 = rec_loss - self.k * series_loss
loss2 = rec_loss + self.k * prior_loss

loss1.backward(retain_graph=True)
loss2.backward()
wuhaixu2016 commented 2 years ago

这个对于最终结果没有影响,您也可以替换两者