GithubHelp home page GithubHelp logo

why is randint? about wavernn HOT 4 CLOSED

hdmjdp avatar hdmjdp commented on August 16, 2024
why is randint?

from wavernn.

Comments (4)

fatchord avatar fatchord commented on August 16, 2024

@hdmjdp This is because the training samples are longer than the number of timesteps that are backpropagated through time. So collate function uses randint to get a random timestep inside whatever 'wiggle room' is available in the spectrogram.

from wavernn.

hdmjdp avatar hdmjdp commented on August 16, 2024

@fatchord thanks, but I use hop_size=120, this may cause "out of index", so if there some methods?
"
pad = 2
mel_win = hp.seq_len // hp.hop_size + 2 * pad

max_offsets = [x[0].shape[-1] - (mel_win + 2 * pad) for x in batch]   
mel_offsets = [np.random.randint(0, offset) for offset in max_offsets]
# mel_offsets = [np.random.randint(0, int(offset * 0.8)) for offset in max_offsets]
sig_offsets = [(offset + pad) * hp.hop_size for offset in mel_offsets]

mels = [x[0][:, mel_offsets[i]:mel_offsets[i] + mel_win] \
        for i, x in enumerate(batch)]

coarse = [x[1][sig_offsets[i]:sig_offsets[i] + hp.seq_len + 1] \
          for i, x in enumerate(batch)]

"
i just multply 0.8 to solve this problem:
mel_offsets = [np.random.randint(0, int(offset * 0.8)) for offset in max_offsets]

from wavernn.

hdmjdp avatar hdmjdp commented on August 16, 2024

@fatchord Did you have better methods?thansks!

from wavernn.

geneing avatar geneing commented on August 16, 2024

@hdmjdp did you regenerate training set after changing hop_size? When mel spectrograms are generated, hop_size is one of the parameters. If you change hop_size and don't regenerate mel spec data, it will be inconsistent and you'll get out of index problem.

Also, notice that upsampling filter sizes are also tied to the hop_size (product of upsampling filter multipliers has to match closely the hop size). If I understand this code correctly, of course....

from wavernn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.