nnsvs.train_util.compute_pitch_regularization_weight

nnsvs.train_util.compute_pitch_regularization_weight(segments, N, decay_size=25, max_w=0.5)[source]

Compute pitch regularization weight given note segments

Parameters:
  • segments (list) – list of note (start, end) indices

  • N (int) – number of frames

  • decay_size (int) – size of the decay window

  • max_w (float) – maximum weight

Returns:

weights of shape (N,)

Return type:

Tensor