Skip to content

Conversation

@sdatkinson
Copy link
Owner

big exhale

Bugs fixed:

  • Real-time allocation issues in Conv1x1 and gated activations
  • Fixed a wrong output size in wavenet::Layer when head 1x1 is active
  • Assert there's no post-head 1x1 FiLM if there's no head 1x1.
  • Rename JSON "groups" to "groups_input"
  • Add Grouped convolutions for input mixin
  • Consolidate post-gating activation FiLM to just post-activation FiLM.

Added wavenet_a2_max.nam, which shows off all of the new features in v0.4.0.

Resolves #197

Adds groups_input_mixin parameter to control grouped convolutions in the
input_mixin Conv1x1 layer. The parameter is propagated through Layer,
LayerArrayParams, and LayerArray constructors. Factory parsing defaults
to 1 if not specified in the model JSON for backward compatibility.

Also fixes a bug in test_real_time_safe where make_layer_all_films was
incorrectly activating head1x1_post_film when head1x1 was inactive.
Aligns the JSON configuration key with the LayerArrayParams attribute name
for consistency. The factory now reads 'groups_input' instead of 'groups'
from the layer configuration.
…ilm_params

Removed the separate gating_activation_post_film_params parameter and now use
activation_post_film_params for both gated and blended modes. This simplifies
the API and reduces redundancy since both modes apply FiLM modulation after
activation in the same way.

Changes:
- Removed gating_activation_post_film_params parameter from _Layer,
  _LayerArray, and LayerArrayParams constructors
- Removed _gating_activation_post_film member variable from _Layer
- Updated _Layer::Process() to use _activation_post_film for gated mode
- Updated all test files to use 7 FiLM parameters instead of 8
- Updated weight count in test_real_time_safe.cpp accordingly
Update WaveNet C++ code to handle secondary_activation as ActivationConfig
instead of string for proper type safety. This enables support for complex
activation types with parameters (e.g., PReLU, LeakyHardtanh).

Changes:
- Modify _Layer, _LayerArray, and LayerArrayParams to use typed ActivationConfig
- Update Factory function to parse secondary_activation from JSON as ActivationConfig
- Update all test files to use ActivationConfig for secondary activation parameters

All tests pass successfully.
Fixed two bugs in _Layer constructor:
- Conv1D was missing groups_input parameter (always defaulted to 1)
- Conv1x1 _1x1 was passing groups_1x1 as bias parameter instead of groups

These fixes enable proper grouped convolutions for reduced computation.
- Fix incorrect parameter comments (lines 713-720): corrected parameter names to match actual Layer constructor
- Fix misleading comment on activation_post_film weight calculation: clarify that FiLM is created with bottleneck as input_dim, shift doubles output channels
- Remove 4 extra placeholder weights that were causing assertion failures
- Apply same fixes to test_layer_post_activation_film_blended_realtime_safe
…on paths

- Use Eigen::Ref in FiLM::Process and Conv1x1::process_ to accept block
  expressions without creating temporary matrices
- Add pre-allocated buffers in GatingActivation and BlendingActivation
  to avoid allocating MatrixXf objects in processing loops
When head_1x1 was active with out_channels != bottleneck, _head_inputs
and _head_rechannel were incorrectly sized using bottleneck instead of
head_1x1.out_channels, causing an Eigen matrix dimension mismatch.

Added _head_output_size member to _LayerArray that correctly computes
the head output size (head_1x1.out_channels if active, else bottleneck).
Updated weight generator to match.
@sdatkinson sdatkinson merged commit be317cf into main Jan 21, 2026
1 check passed
@sdatkinson sdatkinson deleted the 197-a2-max branch January 21, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

End-to-end test with a WaveNet with all new features

2 participants