from mxnet import nd
prob_each = nd.array([0.5,0.5])#.reshape(1,2)
for k in range(3):
a = nd.random.multinomial(prob_each,shape=(2,1)).asnumpy()
print a,’-’
hi all i run codes above many times with all results are 1.
but i think it should output 0 or 1 randomly?
In the meantime, I can only recommend using numpy to draw samples from the multinominal distribution and then convert it into NDArray by mx.nd.array(np_array).