Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch_size padding may not be working #98

Closed
chadcwilliams opened this issue Apr 30, 2024 · 2 comments
Closed

patch_size padding may not be working #98

chadcwilliams opened this issue Apr 30, 2024 · 2 comments
Assignees
Labels
bug Something isn't working gan relevant to gan development priority 1: needed These are highly desirable to be fixed, ideally within 2 weeks.
Milestone

Comments

@chadcwilliams
Copy link
Collaborator

We need to check to make sure that padding the data when patch_size cannot cut it equally is working. It does not work on the main branch and I have had suspicions that it was not working before.

@chadcwilliams chadcwilliams added bug Something isn't working priority 1: needed These are highly desirable to be fixed, ideally within 2 weeks. gan relevant to gan development labels Apr 30, 2024
@chadcwilliams chadcwilliams added this to the EEG-GAN v2.0 milestone Apr 30, 2024
@whyhardt
Copy link
Collaborator

automatic padding faces an issue with AE-GAN. For normal GAN it was simple - just add n zeros to the real sequence. Then sequence_length % patch_size == 0. With AE-GAN we cannot do it like that because adding zeros to the dataset does not work with AE(target=['full', 'time']). Adding an automatic mechanism that unifies GAN and AE-GAN would be to adjust the generation method to (1) create a sequence of length len % patch_size==0 and (2) remove the unnecessary points in the array with generated[:, :-padding, :] after generation but before returning the sequence. But since this would modify the fundamental generation method and we did not test it, I would simply remove automatic padding and print an error that it does not work with the defined padding size. Then the user has two options: adjust sequence_length of the data or patch_size. Since patch_size is a simple argument that would be the preferred solution. If the sequence_length is a prime number -> not our problem; better don't use such a weird format anyways ;)

@whyhardt
Copy link
Collaborator

whyhardt commented May 10, 2024

I added a dynamic error message which distinguished between GAN and AE-GAN:

For GAN:

ValueError: Sequence length (100) must be a multiple of patch size (7). Please adjust the 'patch_size' or adjust the sequence length of the dataset.

For AE-GAN:

ValueError: Sequence length (10) must be a multiple of patch size (7). Please adjust the 'patch_size' or adjust the output sequence length of the autoencoder ('time_out').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gan relevant to gan development priority 1: needed These are highly desirable to be fixed, ideally within 2 weeks.
Projects
None yet
Development

No branches or pull requests

2 participants