Commit fbf4f0e
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)
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: 8775579491 parent d55b500 commit fbf4f0e
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
| 331 | + | |
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
| 514 | + | |
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| |||
0 commit comments