Skip to content
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

Does anyone face the same issue? #12

Open
saitaiky opened this issue Mar 22, 2017 · 4 comments
Open

Does anyone face the same issue? #12

saitaiky opened this issue Mar 22, 2017 · 4 comments

Comments

@saitaiky
Copy link

saitaiky commented Mar 22, 2017

def __sample(a, temperature=1.0):
a = np.log(a) / temperature
a = np.exp(a) / np.sum(np.exp(a))
return np.argmax(np.random.multinomial(1, a, 1))

It shows up multinomial has an error
np.argmax(np.random.multinomial(1, a, 1))
File "mtrand.pyx", line 4593, in mtrand.RandomState.multinomial (numpy\random\mtrand\mtrand.c:37541)
ValueError: sum(pvals[:-1]) > 1.0

@Echo-Ji
Copy link

Echo-Ji commented Apr 10, 2017

Yeah, when i make epochs greater than 26, this error will appear and I really want to know how to solve it.

@emc2-2022
Copy link

facing the same problem.

@cagostino
Copy link

A workaround for this problem from essentially a clone of this repo is available here:
llSourcell/How-to-Generate-Music-Demo#4

@GyeowoonJeong
Copy link

I found that someone said it occurs because of type casting.
I fixed like this, and I could fix the error.

def __sample(a, temperature=1.0):
a = np.asarray(a).astype('float64')
a = np.log(a) / temperature
a = np.exp(a) / np.sum(np.exp(a))
return np.argmax(np.random.multinomial(1, a, 1))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants