-
Notifications
You must be signed in to change notification settings - Fork 105
[FEATURE] FiLMs in wavenet::Layer
#196
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Updated FiLM constructor to accept a boolean shift parameter, modifying the internal scaling logic accordingly. - Adjusted get_input_dim method to return the correct dimension based on the shift parameter. - Refactored the process method to conditionally apply shift during output calculation. - Added comprehensive tests for FiLM functionality, covering both shift and scale-only scenarios. This update improves the flexibility of the FiLM class for various use cases.
- Add Process_ method to FiLM for in-place processing - Add tests for Process_ with shift enabled - Add tests for Process_ with scale-only mode - Add tests for partial frame processing to ensure only first num_frames are modified
- Fixed _FiLMParams struct syntax - Added FiLM parameter members to LayerArrayParams (9 FiLM layers) - Updated _Layer constructor to accept and initialize FiLM objects - Updated _LayerArray constructor to pass FiLM parameters to layers - Added factory parsing for FiLM parameters from JSON config - FiLM objects are initialized when active=true in parameters - Added SetMaxBufferSize() and set_weights_() support for all FiLM objects
- Created helper functions in all test files to reduce duplication: - make_default_film_params() - returns default (inactive) FiLM parameters - make_layer() - creates _Layer with default FiLM parameters - make_layer_array() - creates _LayerArray with default FiLM parameters - make_layer_array_params() - creates LayerArrayParams with default FiLM parameters - Updated all test files to use helper functions instead of direct constructors - Removed duplicate code from test files - All tests now compile and build successfully
- Added helper function make_layer_all_films() to create Layer with all FiLMs active - Added test_layer_all_films_with_shift_realtime_safe() - tests with shift=true - Added test_layer_all_films_without_shift_realtime_safe() - tests with shift=false - Both tests verify no memory allocations occur during Process() calls - Tests cover all 8 active FiLMs (excluding head1x1_post_film when head1x1 is inactive) - Tests multiple buffer sizes (1, 8, 16, 32, 64, 128, 256) - Fixed weight calculations: shift=true needs 4 weights per FiLM, shift=false needs 2 weights per FiLM - Registered tests in run_tests.cpp
- Created shared helper function test_layer_all_films_realtime_safe_impl() that takes shift parameter - Both test functions now call the helper with their respective shift values - Consolidated weight calculation logic into single conditional block - Dynamic test name generation based on shift parameter - Reduced code duplication significantly while maintaining same functionality
Resolve merge conflicts to combine FiLM support with the new typed ActivationConfig API from main. The merged code uses ActivationConfig instead of string-based activation names while preserving all FiLM parameters in the wavenet Layer and LayerArray constructors.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This puts a ton of FiLM layers into
wavenet::Layer. Not all of them will be equally-useful, but this will let us check them all out and see what looks good.Resolves #176 .