Skip to content

Default arguments logging is confusing #21

Description

@RMeli

The function

def print_args(
args: argparse.Namespace, header: Optional[str] = None, stream=sys.stdout
):
"""
Print command line arguments to stream.py
Parameters
----------
args: argparse.Namespace
Command line arguments
header: str
stream:
Output stream
"""
if header is not None:
print(header, file=stream)
for name, value in vars(args).items():
if type(value) is float:
print(f"{name}: {value:.5E}", file=stream)
else:
print(f"{name} = {value!r}", file=stream)
# Flush stream
print("", end="", file=stream, flush=True)

is too simplistic. This function prints out all the CLI arguments to the log file, including the default ones.

This might be confusing at times. For example, when there is no binding affinity annotation the following is printed to the log file:

[...]
affinity_pos = None
[...]
pseudo_huber_affinity_loss = False
delta_affinity_loss: 4.00000E+00
scale_affinity_loss: 1.00000E+00
penalty_affinity_loss: 1.00000E+00
[...]

Only the variables that are relevant for the run should be printed out. In this case affinity_pos = None should be printed (to indicate that there is no binding affinity annotation), but everything else is superfluous and confusing.

The same happens for dynamic learning rate:

[...]
lr_dynamic = False
lr_patience = 5
lr_reduce: 1.00000E-01
lr_min: 1.00000E-05
[...]

lr_dynamic = False should be printed, everything else is superfluous and confusing.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions