lucidrains / vector-quantize-pytorch

Vector (and Scalar) Quantization, in Pytorch
MIT License
2.66k stars 216 forks source link

output dimensions for vector quantize #168

Open dorsa-zeinali opened 4 weeks ago

dorsa-zeinali commented 4 weeks ago

Hi, I have data that is the shape (batch, channel, height, width), I want to quantize it and I was wondering what the dimension of the vectorquantizer should be. I tried dim=height, but it produces something of dimensions [1, channel] when I need something of the dimension [batch, channel]. any help would be appreciated. thanks

lucidrains commented 4 weeks ago

could you show a short example script? I can make the correction for you easier that way

dorsa-zeinali commented 4 weeks ago
Screenshot 2024-10-28 at 1 25 36 PM

Here is the description of my model. my code is rather long , should I include other information? although I solved the issue by setting the batch size to 1. If I train this network, will it also update the codebook with the optimizer? or will the updates just be ema ?