Skip to content

parameter_scheduler

Source code in tinybig/util/utility.py
def parameter_scheduler(strategy: str = 'half', parameter_list: list = None, lower_bound: int = 1):
    if parameter_list is None:
        raise ValueError("Parameter list must be provided.")
    if strategy == 'half':
        result = [max(int(parameter/2), lower_bound) if parameter is not None else None for parameter in parameter_list]
        return result
    else:
        raise ValueError("Parameter strategy not supported.")