When retrieving an optimizer, the map first attempts an exact key match. If
no exact match is found, it treats every key as a regular-expression pattern
and performs a full match against the variable path. For example,
"encoder" matches only the layer with that exact path; use
"encoder/.*" to match its sublayers. Exact matches take precedence. If
more than one regular expression matches, lookup raises an error. Variables
not matched by the map use default_optimizer.
Examples
optimizers <- optimizer_map(
default_optimizer = optimizer_sgd(),
optimizer_map = list("encoder/.*" = optimizer_adam())
)See also
Other optimizers: optimizer_adadelta() optimizer_adafactor() optimizer_adagrad() optimizer_adam() optimizer_adam_w() optimizer_adamax() optimizer_ftrl() optimizer_lamb() optimizer_lion() optimizer_loss_scale() optimizer_multi() optimizer_muon() optimizer_nadam() optimizer_rmsprop() optimizer_schedule_free_adam_w() optimizer_sgd()