'Given an array of document indices, return a vector
for each document of just the unnormalized topic weights.
Returns:
doc_weights : chainer.Variable
Two dimensional topic weights of each document.'

def proportions(self, doc_ids, softmax=False):

    w = self.weights(doc_ids)
    if softmax:
        size = w.data.shape
        mask = self.xp.random.random_integers(0, 1, size=size)
        y = (F.softmax((w * self.temperature)) * Variable(mask.astype('float32')))
        (norm, y) = F.broadcast(F.expand_dims(F.sum(y, axis=1), 1), y)
        return (y / (norm + 1e-07))
    else:
        return w
