I am confused about the random_multinomial_choice() function in your train_cbow_weighted.py file.
The condition of if sentence seems not right.. More likely, if y>=x: should be here.
In my opinion, if the play time of a game is quite bigger, this game should be return.
Am I right?
Waiting for your reply.
And here is your code.
def random_multinomial_choice(tuples):
x = random.random()
total = sum([hours for _, hours in tuples])
for game, hours in tuples:
y = hours / total
if y <= x:
return game
x -= y
return tuples[-1][0]
I am confused about the random_multinomial_choice() function in your
train_cbow_weighted.py
file. The condition of if sentence seems not right.. More likely,if y>=x:
should be here. In my opinion, if the play time of a game is quite bigger, this game should be return. Am I right? Waiting for your reply.And here is your code.