Skip to content

change defaults for Dropout and BatchNorm#5299

Open
copybara-service[bot] wants to merge 1 commit intomainfrom
test_877557940
Open

change defaults for Dropout and BatchNorm#5299
copybara-service[bot] wants to merge 1 commit intomainfrom
test_877557940

Conversation

@copybara-service
Copy link

change defaults for Dropout and BatchNorm

Changes Dropout.deterministic and BatchNorm.use_running_average to be None by default, use now has to explicitely provide them by either:

  1. Passing them to the constructor e.g:

self.bn = nnx.BatchNorm(..., use_running_average=False)

  1. Passing them to call:

self.dropout(x, deterministic=False)

  1. Using nnx.view to create a view of the model with specific values:

train_model = nnx.view(model, detereministic=False, use_running_average=False)

Changes `Dropout.deterministic` and `BatchNorm.use_running_average` to be None by default, use now has to explicitely provide them by either:

1. Passing them to the constructor e.g:

  self.bn = nnx.BatchNorm(..., use_running_average=False)

2. Passing them to __call__:

  self.dropout(x, deterministic=False)

3. Using `nnx.view` to create a view of the model with specific values:

  train_model = nnx.view(model, detereministic=False, use_running_average=False)

PiperOrigin-RevId: 877557940
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.

0 participants