StableRecon / dust3r /optim_factory.py
Stable-X's picture
Upload folder using huggingface_hub
e4bf056 verified
raw
history blame
518 Bytes
# Copyright (C) 2024-present Naver Corporation. All rights reserved.
# Licensed under CC BY-NC-SA 4.0 (non-commercial use only).
#
# --------------------------------------------------------
# optimization functions
# --------------------------------------------------------
def adjust_learning_rate_by_lr(optimizer, lr):
for param_group in optimizer.param_groups:
if "lr_scale" in param_group:
param_group["lr"] = lr * param_group["lr_scale"]
else:
param_group["lr"] = lr