Skip to content

Conversation

@Ilya-Fradlin
Copy link
Contributor

Previously, reset_parameters() set gamma to ones, ignoring init_values and effectively disabling LayerScale’s small-init behavior.

Now, gamma is initialized to init_values via nn.init.constant_ preserving the intended effect.

@rwightman
Copy link
Collaborator

rwightman commented Nov 4, 2025

@Ilya-Fradlin thanks, FYI I have quite a bit set of changes like/related to this to implement a two phase init, but will merge this one regardless. EDIT woops I cut that off... becuase there's a regression here, I removed a number of local 'LayerScale' impl that did not have this issue and used this central one which does have the problematic reset... was probably in my changes a month back.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@rwightman rwightman merged commit ce73a2c into huggingface:main Nov 4, 2025
22 checks passed
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.

3 participants