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

Feature plots description #116

Merged
merged 17 commits into from
Jul 13, 2020
Merged

Conversation

Bartolo1024
Copy link
Collaborator

@Bartolo1024 Bartolo1024 commented Jul 9, 2020

Changelist:

  • decorations in matplotlib output
  • step names in main logger
  • test for step names
  • matplotlib api with object api
  • matplotlib decoration in Readme.md

Notes:

step_name(group_name) function is more comfortable to handle default value than access to a pure dictionary

@@ -24,10 +24,11 @@ def __init__(
current_step: int = -1,
auto_generate_groups_if_not_available: bool = True,
auto_generate_metric_to_name: bool = True,
group_patterns: List[Tuple[str, str]] = [
group_patterns: List[Tuple[Pattern, str]] = [
(r'^(?!val(_|-))(.*)', 'training '),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we shouldn't have space after (e.g. 'training' not 'training ').

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 165 to 169
def step_name(self, group_name: str) -> str:
if isinstance(self._step_names, str):
return self._step_names
else:
return self._step_names.get(group_name, 'epoch')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is OK, but I think it would be more idiomatic to use DefaultDict (but it can stay as it is).

Comment on lines +44 to +46
self._after_subplot = after_subplot if after_subplot else self._default_after_subplot
self._before_plots = before_plots if before_plots else self._default_before_plots
self._after_plots = after_plots if after_plots else self._default_after_plots
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice pattern

Comment on lines 54 to 55
clear_output(wait=True)
plt.figure(figsize=(figsize_x, figsize_y))
self._before_plots(len(log_groups))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clear_output should be in before_plots.

Copy link
Owner

@stared stared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, it is nice!

A few things (except for the ones in one-line comments):

  • Adding a section to README with an example (e.g. no legend, log scale)
  • Did you try to use this object-oriented API (ax. not plt.)?

@Bartolo1024 Bartolo1024 requested a review from stared July 13, 2020 11:41
ax.set_xlabel(x_label)
ax.legend(loc='center right')

def _default_before_plots(self, figure: plt.Figure, num_of_log_groups: int) -> None:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and in other places: it is idiomatic to use fig not figure.

@stared
Copy link
Owner

stared commented Jul 13, 2020

And one more thing: in Jupyter Notebook:

  • installation output does not look like for --quiet
  • the whole header should be updated (title, link to Colab, version 0.5.2 (or 0.6.0?)

@Bartolo1024
Copy link
Collaborator Author

done

@stared stared merged commit 2fb117d into stared:master Jul 13, 2020
@Bartolo1024 Bartolo1024 deleted the feature-plots-description branch July 15, 2020 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants