I have a function which is meant to be extendable, and would like to ensure that all input parameters keep being logged without the need to manually check/add them. Is there a way to do this automatically?
def __init__(self, model_name: str, num_classes: int, device: str = 'cuda:0', learning_rate: float = 5e-5,
do_layer_freeze: bool = True, extra_class_layers: Optional[Union[int, list]] = None,
fine_tune_dropout_rate: float = 0):
For scikit learn models this happens naturally using the autologger but doesn’t seem to with pytroch (Lightning). Currently, I am having to do it the manual way:
mlflow.log_params({'model_name': model_name,
'num_classes': num_classes,
'learning_rate': learning_rate,
'do_layer_freeze': do_layer_freeze,
'extra_class_layers': extra_class_layers,
'fine_tune_dropout_rate': fine_tune_dropout_rate})