-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Description
🚀 The feature, motivation and pitch
Preserving param names is useful for correlating them with params in other models (e.g. in teacher-student setups). The most natural way for this is dict (list of (name, param) tuples is also fine, but personally I prefer dicts). Another possible format is unpacking it into two lists: params and params_names, but this is less convenient to construct since a bit more boiler plate is needed at construction time or making helpers such as param_group = lambda params_dict, **kwargs: dict(params = list(params_dict.values()), params_names = list(params_dict.keys()), **kwargs) that unpacks a param dict into two lists.
To support this, some plumbing code in optimizers would need to be updated to understand dicts. Or it could normalize dicts into params/params_names lists as I do above. Similar normalization is happening already when a list of params is converted to a dict-like param group
Related: #71683
Alternatives
No response
Additional context
No response