Giter Club home page Giter Club logo

Comments (5)

xcmyz avatar xcmyz commented on July 18, 2024

alignment.py

from fastspeech.

xcmyz avatar xcmyz commented on July 18, 2024

I'm sorry to reply you so late.

from fastspeech.

fastcode3d avatar fastcode3d commented on July 18, 2024

您好,谢谢您的实现以及回复,对我很有帮助.
但关于alignment.py中的get_D函数我还有一些问题

def get_D(alignment):
D = np.array([0 for _ in range(np.shape(alignment)[1])])

for i in range(np.shape(alignment)[0]):
    max_index = alignment[i].tolist().index(alignment[i].max())
    D[max_index] = D[max_index] + 1

for i in range(np.shape(D)[0]):
    if D[i] > 0:
        D[i] = D[i] - 1

return D

其中为什么需要以下的步骤?

for i in range(np.shape(D)[0]):
if D[i] > 0:
D[i] = D[i] - 1

我加上这一步之后,sum(D)=S-T(S and T are the lengths of the ground-truth spectrograms and phonemes),我对原文的理解应该是sum(D)=S.
希望您有空可以帮忙解答一下疑惑,谢谢!

from fastspeech.

xcmyz avatar xcmyz commented on July 18, 2024

不好意思,现在才看到。
那段代码具体的意思是
首先alignment的第二维是字符的长度,
for i in range(np.shape(alignment)[0]):
max_index = alignment[i].tolist().index(alignment[i].max())
D[max_index] = D[max_index] + 1
为的是找到每个mel列中对应的最大的字符的index
D就是一个长度为字符数的计数器

for i in range(np.shape(D)[0]):
if D[i] > 0:
D[i] = D[i] - 1
上面这一步的目的是为了将所有计数减一,并防止0变成负一,因为在之后的代码中,计数为1的字符实际上会扩充成2个,所以需要减一。

from fastspeech.

fastcode3d avatar fastcode3d commented on July 18, 2024

好的,了解了,非常感谢!

from fastspeech.

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.