-
Notifications
You must be signed in to change notification settings - Fork 9
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
Fix measure performance frequency + Add loss log #56
base: master
Are you sure you want to change the base?
Conversation
Now executors can log their values on tensorboard. This allows to have single components of a complex loss on TB. Moreover, it allows logging for losses separate from metric logging.
Work in Progress |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #56 +/- ##
==========================================
+ Coverage 86.67% 87.17% +0.49%
==========================================
Files 56 56
Lines 2162 2206 +44
==========================================
+ Hits 1874 1923 +49
+ Misses 288 283 -5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly my OCD about type hints and docs + two clarifications
src/ashpy/losses/gan.py
Outdated
@@ -114,7 +114,9 @@ def get_discriminator_inputs( | |||
class GeneratorAdversarialLoss(GANExecutor): | |||
r"""Base class for the adversarial loss of the generator.""" | |||
|
|||
def __init__(self, loss_fn: tf.keras.losses.Loss = None) -> None: | |||
def __init__( | |||
self, loss_fn: tf.keras.losses.Loss = None, name="GeneratorAdversarialLoss" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add Type Annotations to both signature and docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also very important: must this name
argument be unique? Does it behave like the name
argument for Metric
and Callback
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the loss name should be unique. We actually log the loss as ashpy/loss_name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where can we specify the fact that the name should be unique?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the documentation + we must keep track of every loss passed to a trainer, store the names and check for duplicates. If there are duplicates, raise an exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add check in trainers, need to add documentation.
Description
Fixes #58
Fixes #57
Fixes #53
Fixes #60
Fixes examples (they were broken)
Type of change
Please delete options that are not relevant.
Checklist: