Skip to content

quant_loss inconsistent with paper #62

Description

@cx-333

In src/IBQ/modules/vqvae/quantize.py, the quantization loss is computed as:

    quant_loss = torch.mean((z_q - z)**2) + torch.mean((z_q_2.detach()-z)**2) + self.beta * \
               torch.mean((z_q_2 - z.detach()) ** 2)

However, in the paper, the equation is:

Image

Does this affect the results?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions