Skip to content

Codebook diversity loss incorrect #227

@pfeatherstone

Description

@pfeatherstone

At this line:

prob = (-distances * self.codebook_diversity_temperature).softmax(dim = -1)

distances is already negative from

If distances were positive then the diversity loss would be correct i think. You can check this my comparing:

torch.testing.assert_close(embed_idx, prob.argmax(-1))

At line

prob = (-distances * self.codebook_diversity_temperature).softmax(dim = -1)

This will fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions