-
Notifications
You must be signed in to change notification settings - Fork 60
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
ValueError: sum(pvals[:-1]) > 1.0 #4
Comments
Here is my solution: The problem is because of the probabilities sometimes sum to just above 1.0 |
Thanks a lot for this workaround, had the same issue. @llSourcell Please adopt it |
Had this problem too, @saitai0802 patch seems to allow it to continue and finish. not shure if the result is better, if the probabilities are adding up to more than 1, something else is causing that. |
I have the same issue was fixed with the workaround then I got another error that said I needed to install pygame after that it worked but I also had a bunch of errors before posting here, like a whole bunch of the code was written for python 2 but I'm using python 3.....not sure if I was supposed to use python 2 at the start |
I have uploaded a python3 version here - for anyone who needs it |
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
The text was updated successfully, but these errors were encountered: