yaodongyu / TRADES

TRADES (TRadeoff-inspired Adversarial DEfense via Surrogate-loss minimization)
MIT License
518 stars 123 forks source link

trades_loss doesn't return the model to model.train() #32

Closed talrub closed 3 months ago

talrub commented 3 months ago

Hi,

At the beginning of the 'trades_loss' function, you set model.eval(), but you don't set model.train() before returning from the function. Isn't that a problem?