-
Notifications
You must be signed in to change notification settings - Fork 10
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
added a little helper function to vggish to get features from waveforms #31
Conversation
NB: tests pass and coverage is good locally, i anticipate no problems even if travis takes forever. |
|
||
Returns | ||
------- | ||
time_points : np.ndarray, len=n |
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.
per #29, we're making a conscious decision to converge to time_points
then?
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 literally just copied over from the existing functions. If we rename, we should do it all at once, and i think it's independent of this pr.
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.
👍
The output features, with or without PCA compression and quantization. | ||
''' | ||
|
||
import tensorflow as tf |
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.
what's the rationale for within-function importing here?
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.
tf import is heavy (sometimes); we shouldn't do it until called for.
If it's already been loaded elsewhere, then this is free.
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.
other than that import, LGTM
Now you can get features directly from waveforms by saying
with
compress=True
(default), the outputs are whitened and quantized. Withcompress=False
they are left as is from the model.This should simplify doing one-off feature extraction in our notebook demos, even if it's less efficient than going through featurefy.