pokaxpoka / deep_Mahalanobis_detector

Code for the paper "A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attacks".
342 stars 78 forks source link

Usability of torch._index_copy method? #5

Closed AlexandrosFerles closed 4 years ago

AlexandrosFerles commented 4 years ago

Dear author,

may I ask what is the use of the torch idex copy method at the lib_generation.py file in lines 171 to 179?

Thank you in advance.

saandeepa93 commented 11 months ago

For anyone else wondering the same, its actually channel-wise normalization of gradients to fall in image space. Although I genuinely have no idea why the complicated indexcopy statements were needed instead of division operation.