If you can sample all the indices first, then you could use indexing to extract the needed rows.
On Fri, Aug 26, 2016, 孙明明 wrote: > Hi, > > I'm writing a gibbs sampling program using theano, where I need to > select a list of random int according to given probability stored in rows > of a matrix. I can do this by scan and choice, since choice only accept a > probability vector and cannot do batch choice on a matrix. > > The procedure seems slow. How can I do this without using scan ? > Thanks. > > Mingming > > -- > > --- > You received this message because you are subscribed to the Google Groups > "theano-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- Pascal -- --- You received this message because you are subscribed to the Google Groups "theano-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
