Problem with the time_warp function
wsstriving opened this issue · 2 comments
wsstriving commented
Hi, should the following line (which defines the position of the warping point)
point_to_warp = horizontal_line_at_ctr[random.randrange(W, spec_len - W)]
be changed to
point_to_warp = random.randrange(W, spec_len - W)
It doesn't make sense in the following computation if we add the specific value with a coordinate shift (dist_to_warp).
src_pts, dest_pts = torch.tensor([[[y, point_to_warp]]]), torch.tensor([[[y, point_to_warp + dist_to_warp]]])
jennycai2 commented
Thanks for your suggestion. Before we decide on the changes, we can first
reach consensus on what the paper (https://arxiv.org/pdf/1904.08779.pdf)
meant in this paragraph:
"Time warping is applied via the function sparse image warp of tensorflow.
Given a log mel spectrogram with τ time steps, we view it as an image where
the time axis is horizontal and the frequency axis is vertical. A random
point along the horizontal line passing through the center of the image
within the time steps (W, τ − W) is to be warped either to the left or
right by a distance w chosen from a uniform distribution from 0 to the time
warp parameter W along that line."
1. divide the horizontal line into multiple sections ("τ time steps")
2. pick one section, then pick a point (y = half of the image height, x is
a random value within the section)
3. get a random value from a uniform distribution from 0 to W, then either
move left or right, so the equivalent is to get a random value between -W
and W.
4. for this section, there are already four corner points, we can pick
three of them, plus the point being warped, we have four points. Among the
four points, the three corner points are unchanged, only that random point
is being moved with a distance equaling to the value obtained in step 3.
If you would elaborate your understanding of the "timing warping" paragraph
in the paper, we would appreciate it a lot. Then code change is just a
breeze :)
Jenny
…On Fri, May 3, 2019 at 7:08 AM wsstriving ***@***.***> wrote:
Hi, should the following line (which defines the position of the warping
point)
point_to_warp = horizontal_line_at_ctr[random.randrange(W, spec_len - W)]
be changed to
point_to_warp = random.randrange(W, spec_len - W)
It doesn't make sense in the following computation if we add the specific
value with a coordinate shift (dist_to_warp).
src_pts, dest_pts = torch.tensor([[[y, point_to_warp]]]), torch.tensor([[[y, point_to_warp + dist_to_warp]]])
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB3YUO33QEYBZNJ5XY7KHD3PTRBPDANCNFSM4HKUHWLQ>
.
zcaceres commented
Closing due to lack to response