Deep-SVDD-PyTorch icon indicating copy to clipboard operation
Deep-SVDD-PyTorch copied to clipboard

Center of volume

Open oattao opened this issue 4 years ago • 8 comments

We don't need to update value of c (center of volume) during the training?

oattao avatar Mar 17 '20 05:03 oattao

We don't need to update value of c (center of volume) during the training?

I think in the code he didn't update R ( in deepSVDD_trainer.py)

snowood1 avatar Apr 26 '20 22:04 snowood1

Do you think that he was wrong?

oattao avatar Apr 26 '20 23:04 oattao

Do you think that he was wrong?

Yes. I think this pytorch version is incomplete compared to the orginal version written in Theano. In this version, one class training and block coordinate optimization is not finished.

snowood1 avatar Apr 27 '20 16:04 snowood1

Do you think that he was wrong?

Yes. I think this pytorch version is incomplete compared to the orginal version written in Theano. In this version, one class training and block coordinate optimization is not finished.

deepSVDD_trainer.py line 94 self.R.data = torch.tensor(get_radius(dist, self.nu), device=self.device)the

I think R is updated. However, according to the paper, the dist should be sorted, but I don't find any code to do this.

jhl13 avatar May 09 '20 14:05 jhl13

We don't need to update value of c (center of volume) during the training?

Yes, We don't need to update the value of c (center of volume) during the training.

jhl13 avatar May 09 '20 14:05 jhl13

Hi, thanks for the discussion. I also noticed the same problem. The paper said that "we found that fixing c in the neighborhood of the initial network outputs made SGD convergence faster and more robust ---(in 3.3 Proposition 1)".I think that mean that 'center' don't need to update.

Was that mean that regard 'center' as a constant made no difference to the result. In other words, theoretically define the 'center' as any constant which satisfy the right shape could also made the model work.

AM I right?

BenedictGreen avatar Jul 31 '20 15:07 BenedictGreen

As you first pre-train the model with an autoencoder, you have pretty good representations in the latent space. When you start training the Encoder only part, you could find two scenarios:

  1. You only have good samples of your class, and thus, taking the mean of this points in the latent space will just do it, since you want this C point to be close to every other point of good sample.
  2. You have good and anomalous samples, and averaging them all will converge the center C to the most represented type in the dataset (like you can see some specific views of planes in cifar-10, or specific shapes of numbers in mnist).

So, no, I don't see any reason why you would update the center during training, but the radius on the other hand, is what makes the edge between anomalous or not, and it is updated during training.

But I don't think you cant initialize it anyway, they initialize and keep it as the mean of one forward pass on your training data.

GabrielDornelles avatar Jul 15 '22 15:07 GabrielDornelles

Hi,I have a question about this code .when there is no pretraining process, what should i do about Initializing the center of the sphere?

ZPP2000 avatar Jul 01 '23 08:07 ZPP2000