Comments (7)
Hi @ybpaopao, if the error gets stuck between 0 and 27.631, then it is highly likely that mode collapse occurs. How do you train UCSD? Are you working with full images, or sliding window patches?
For the adversarial loss, we tried both, and as we said in the paper, feature matching works better. Seems like we forgot to update the code, though. I’ll update the code accordingly.
from ganomaly.
Hi,
Thanks for spotting this! Actually, that is a typo in the paper, which should have been L2 (copy paste issues :) ). However, the results are quite similar when we use L1 as well. You could check it out if you want.
Concerning the loss function, there is no need to do so. When we use the original L1 or L2 loss, we have the following error:
"nn criterions don't compute the gradient w.r.t. targets - please " \
AssertionError: nn criterions don't compute the gradient w.r.t. targets - please mark these tensors as not requiring gradients
The error is because the original L1 or L2 loss functions that come with PyTorch expects two variables, the first of which should be set_grad=True
, while the latter of which should be set_grad=False
. In our case, however, we have two variables, both of which should be set_grad=True
. When we use the function we created (l1_loss), the output of the function is a variable whose gradients are computed by default. You could read more about this from the following link:
https://discuss.pytorch.org/t/how-to-calculate-l1-loss-between-two-variables/2204/4
from ganomaly.
@samet-akcay Thanks for your reply and i'm now understand the loss used in the code. Yes, I found that L1 loss and L2 loss actually achieved similar results. In addition, I wonder if you have tried your method in anomaly detection in videos, such as the UCSD as you mentioned in your code. Does you code can directly read images as input or you have processed the video data before you run GAnomaly? Thanks!
from ganomaly.
We haven't trained UCSD, but one chap opened another issue here #10, raising UCSD training. Most of the video anomaly detection papers use temporal information within the UCSD, which we cannot do via Ganomaly. However, we could still train it like we do for the UBA dataset in the paper. You could read more about this here README.md.
from ganomaly.
@samet-akcay Hi, I wonder if there are any functional differences between your codes of torch0.3 and torch0.4. Are they just implemented with different version of pytorch?
from ganomaly.
@ybpaopao , There is no functional difference. As you said, the only difference is the PyTorch version.
from ganomaly.
@samet-akcay Hi, I tried to implement the work in video anomaly detection. However, I meet some problems when I test the code in UCSD PED dataset according the guidance you provided in readme.txt. The err_d_real and err_d_fake are always 0 and 27.631 from the first iteration. I guess may be the DNet did not work very well. By the way, the adversarial loss you defined in your paper is the L2 loss between the DNet outputs of real sample and a fake generated sample. But I found in the code that "self.err_g_bce = self.bce_criterion(self.out_g, self.label)". It seems that you use the binary entropy-cross error between the true label and the DNet output of the fake generated sample. Does this matters? Or do you have any suggestions about the strange err_d_real and err_d_fake?
from ganomaly.
Related Issues (20)
- how can i balance the model HOT 7
- how can i see the result of test?? HOT 1
- How to distinguish a mnist_pic is normal or anomaly? HOT 17
- Sudden increase of err_d HOT 1
- Changes for Windows10
- Some qutestions about testing
- can it display where is the anomaly when inference? HOT 1
- what is the difference between fixed_fakes_*.png and fakes.png
- Is the testing function missing self.netg.eval? HOT 5
- AttributeError: module 'torch._C' has no attribute '_cuda_setDevice' HOT 4
- What's the performance of the model in terms of custom dataset?
- Can this code be used on sequence data? HOT 1
- How to use ganomaly neural network for single-channel data training
- Program stucks when the input image size is 224x224 HOT 2
- Experiment(To replicate the results in the paper for MNIST and CIFAR10 datasets)
- Testing
- Possible mode collapse HOT 1
- Test problem HOT 2
- Missing net.eval() in the testing code HOT 1
- ROC is changed every time
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ganomaly.