-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support new-style audio summaries #345
Conversation
|
||
FLAGS = tf.flags.FLAGS | ||
|
||
tf.flags.DEFINE_string('logdir', '/tmp/audio_demo', | ||
'Directory into which to write TensorBoard data.') | ||
|
||
tf.flags.DEFINE_integer('steps', 500, | ||
tf.flags.DEFINE_integer('steps', 50, |
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.
(Note: I made this change because it cuts down the output from 617.8 MB to "only" 79.6 MB, not because of anything to do with the new summaries.)
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.
Sounds worth it to me. Maybe note in PR description.
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.
Sure.
2c31866
to
7222873
Compare
5dcdd53
to
b9f711c
Compare
7222873
to
8ef46dc
Compare
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.
Looking forward to all the summaries using SummaryMetadata
! Almost there.
tensorboard/backend/application.py
Outdated
@@ -41,12 +41,12 @@ | |||
from tensorboard.backend.event_processing import event_multiplexer | |||
from tensorboard.plugins import base_plugin | |||
from tensorboard.plugins.core import core_plugin | |||
from tensorboard.plugins.audio import metadata as audio_metadata |
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.
Nit: I think audio comes before core.
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.
After deep self-reflection, I think so, too. thanks :-)
}, | ||
_hasMultipleSamples: { | ||
type: Boolean, | ||
computed: "_computeHasMultipleSamples(ofSamples)", |
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.
Nit: Maybe numberOfSamples?
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.
It's not clear to me what you're suggesting. We can't change ofSamples
to numberOfSamples
on this line (this is an argument name, not a parameter name); do you want to rename the property entirely?
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.
Yeah - maybe renaming the property to numberOfSamples
is more clear?
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.
Okay. It introduces a dissimilarity between this and the image dashboard, but that's not the end of the world.
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.
(I'm using totalSamples
because with numberOfSamples
one is more likely to incorrectly infer that a particular card has multiple samples; using totalSamples
clarifies that the aggregation is done at a higher level than the individual cards.)
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.
Sounds good.
|
||
FLAGS = tf.flags.FLAGS | ||
|
||
tf.flags.DEFINE_string('logdir', '/tmp/audio_demo', | ||
'Directory into which to write TensorBoard data.') | ||
|
||
tf.flags.DEFINE_integer('steps', 500, | ||
tf.flags.DEFINE_integer('steps', 50, |
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.
Sounds worth it to me. Maybe note in PR description.
I've been excited to save the easiest for last—one |
8ef46dc
to
225393f
Compare
b9f711c
to
8e833ab
Compare
225393f
to
5aee0dc
Compare
Summary: This commit adds support for new-style audio summaries to the plugin frontend and backend. Here is a screenshot of the resulting dashboard: ![Screenshot](https://user-images.githubusercontent.com/4317806/29231118-d1ce0a44-7e9a-11e7-8029-0ffff6ab44de.png) This change is fully compatible with the old data format. While I was editing the demo, I changed its step count from 500 to 50. Because we encode into WAV (ugh), the old demo was generating 617.8 MB of data. It now generates “only” 79.6 MB. (This change has nothing to do with the actual new summaries.) Test Plan: Run `bazel run //tensorboard/plugins/audio:audio_demo` to get data using new-style audio summaries. Also grab some old-style audio summaries, perhaps by running the version of that target that appeared before this commit (and changing the logdir to avoid writing into the same directory). Launch a TensorBoard with a logdir enclosing all of this data, and verify that it all renders correctly. When running `bazel test //tensorboard/...`, be aware that this diff contains a particularly large number of uses of `tf.compat.as_bytes` and friends. Thus, it is wise to run this test command in both py2 and py3 virtualenvs. wchargin-branch: new-style-audio-frontend
5aee0dc
to
8ffd715
Compare
Summary: This was a relic of a piecewise migration from the `event_accumulator`’s old form to its current `plugin_event_accumulator` form. (See #345 for an example of one of the intermediate states.) Now totally superfluous, it incurs needless cognitive and CPU overhead, as the `getattr` blocks standard optimizations. Test Plan: All tests pass, and TensorBoard can still load the standard demo data. wchargin-branch: eliminate-metaprogramming
Summary: This was a relic of a piecewise migration from the `event_accumulator`’s old form to its current `plugin_event_accumulator` form. (See #345 for an example of one of the intermediate states.) Now totally superfluous, it incurs needless cognitive and CPU overhead, as the `getattr` blocks standard optimizations. Test Plan: All tests pass, and TensorBoard can still load the standard demo data. wchargin-branch: eliminate-metaprogramming
Summary:
This commit adds support for new-style audio summaries to the plugin
frontend and backend.
Here is a screenshot of the resulting dashboard:
This change is fully compatible with the old data format.
Test Plan:
Run
bazel run //tensorboard/plugins/audio:audio_demo
to get datausing new-style audio summaries. Also grab some old-style audio
summaries, perhaps by running the version of that target that appeared
before this commit (and changing the logdir to avoid writing into the
same directory). Launch a TensorBoard with a logdir enclosing all of
this data, and verify that it all renders correctly.
When running
bazel test //tensorboard/...
, be aware that this diffcontains a particularly large number of uses of
tf.compat.as_bytes
andfriends. Thus, it is wise to run this test command in both py2 and py3
virtualenvs.
wchargin-branch: new-style-audio-frontend