Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Add tests to vector quantizer layer#97

Merged
Warvito merged 5 commits intomainfrom
75_vector_quantizer_layer_tests
Dec 5, 2022
Merged

Add tests to vector quantizer layer#97
Warvito merged 5 commits intomainfrom
75_vector_quantizer_layer_tests

Conversation

@Warvito
Copy link
Copy Markdown
Collaborator

@Warvito Warvito commented Nov 30, 2022

Fix ( #75)

danieltudosiu and others added 3 commits November 29, 2022 00:44
Signed-off-by: Walter Hugo Lopez Pinaya <ianonimato@hotmail.com>
@danieltudosiu
Copy link
Copy Markdown
Contributor

Thank you for having a go at this. I think we are missing the following two tests:

  1. Test if the EMA logic is working. This could be done by initialising the embedding weights with sequential integers filled vectors and then pick one of the integers generate a batch of images filled with that integer and apply some random gaussian noise to those image. The test would then assert if the integer filled vector from the embedding space is the only one that is changed.

  2. We should also test the DDP by applying test 1 to both DDP enabled and non-DDP and asserting if the embedding dictionaries are the same.

@Warvito
Copy link
Copy Markdown
Collaborator Author

Warvito commented Dec 4, 2022

I created a issue for the distributed tests #123

@Warvito
Copy link
Copy Markdown
Collaborator Author

Warvito commented Dec 4, 2022

Test if the EMA logic is working. This could be done by initialising the embedding weights with sequential integers filled vectors and then pick one of the integers generate a batch of images filled with that integer and apply some random gaussian noise to those image. The test would then assert if the integer filled vector from the embedding space is the only one that is changed.

This is not what is implemented. I think you forgot about the decay component. In the end, all weights change. Testing the EMA logic would be a little more difficult maybe we could leave without this test for now

@danieltudosiu
Copy link
Copy Markdown
Contributor

@Warvito sorry, I don't really understand what you mean. Should we take this IRL so we can create a complete test?

Signed-off-by: Walter Hugo Lopez Pinaya <ianonimato@hotmail.com>
@Warvito
Copy link
Copy Markdown
Collaborator Author

Warvito commented Dec 5, 2022

I added the test as we discussed

@Warvito Warvito requested review from danieltudosiu and removed request for danieltudosiu December 5, 2022 12:55
@Warvito Warvito merged commit cc1d60c into main Dec 5, 2022
@Warvito Warvito deleted the 75_vector_quantizer_layer_tests branch December 5, 2022 23:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing unit tests for networks/layers/vector_quantizer.py

2 participants