Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default arguments logging is confusing #21

Open
RMeli opened this issue Feb 25, 2022 · 0 comments
Open

Default arguments logging is confusing #21

RMeli opened this issue Feb 25, 2022 · 0 comments

Comments

@RMeli
Copy link
Owner

RMeli commented Feb 25, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant