Training utilities
Utilities
get_lr_scheduler
get_lr_scheduler (cfg, lr)
Return A LearningRateSchedule.
Supports cosine_decay, exponentialdecay and cosine_decay_restarts.
Type | Details | |
---|---|---|
cfg | cfg (omegaconf.DictConfig): | Hydra Configuration |
lr | str | learning rate |
Returns | keras.api._v2.keras.optimizers.schedules | A LearningRateSchedule |
get_model_weights
get_model_weights (train_ds:tensorflow.python.data.ops.dataset_ops.Datas etV2)
Return model weights dict.
Type | Details | |
---|---|---|
train_ds | DatasetV2 | Tensorflow Dataset. |
Returns | dict | Dictionary of class weights. |
/opt/homebrew/Caskroom/miniconda/base/envs/rocks/lib/python3.9/site-packages/fastcore/docscrape.py:225: UserWarning: Unknown section Raises
else: warn(msg)
get_optimizer
get_optimizer (cfg, lr:str)
Get optimizer set with an learning rate.
Type | Details | |
---|---|---|
cfg | cfg (omegaconf.DictConfig): | Hydra Configuration |
lr | str | learning rate |
Returns | keras.api._v2.keras.optimizers | Tensorflow optimizer |