vector-quantize-pytorch icon indicating copy to clipboard operation
vector-quantize-pytorch copied to clipboard

How to train this?

Open umbertov opened this issue 3 years ago • 2 comments
trafficstars

Hi, I want to use this package to experiment with data different than images (multivariate time series). I see that the commitment_loss that is returned is not a tensor, but rather a built in float, hence it's not possible to backprop through it.

For now i didn't modify any of my other loss calculation code, i just plugged in the quantizer at the beginning of my architecture, but i'd like to be sure if this is the correct way to go about this.

Thanks and keep up, you're doing god's work with your repositories!

umbertov avatar Dec 03 '21 11:12 umbertov

@umbertov hey! so actually the commitment loss is not that important, and you can just set commitment = 0 during init and it should work fine (i built it a long time ago)

however, if you do use any of the auxiliary losses, try the latest version and see if it now work

lucidrains avatar Dec 03 '21 16:12 lucidrains

What do you mean by "the commitment loss is not that important"? Isn't it the main loss that drives the codebook vectors? Could you please clarify how to train this module by adding an example in the readme?

RafailFridman avatar Dec 16 '21 11:12 RafailFridman