'Given an array of document integer indices, returns a vector
for each document. The vector is composed of topic weights projected
onto topic vectors.
Args:
doc_ids : chainer.Variable
One-dimensional batch vectors of IDs
Returns:
doc_vector : chainer.Variable
Batch of two-dimensional embeddings for every document.'

def __call__(self, doc_ids, update_only_docs=False):

    proportions = self.proportions(doc_ids, softmax=True)
    factors = F.dropout(self.factors(), ratio=self.dropout_ratio)
    if update_only_docs:
        factors.unchain_backward()
    w_sum = F.matmul(proportions, factors)
    return w_sum
