def __call__(self, outputs):
output = outputs[self.output_name]<EOL>k = output.shape[-<NUM_LIT:1>]<EOL>n = TT.prod(output.shape) // k<EOL>prob = output.reshape((n, k))[TT.arange(n), self._target.reshape((n, ))]<EOL>nlp = -TT.log(TT.clip(prob, <NUM_LIT>, <NUM_LIT:1>))<EOL>if self._weights is not None:<EOL><INDENT>return (self._weights.reshape((n, )) * nlp).sum() / self._weights.sum()<EOL><DEDENT>return nlp.mean()<EOL>
Construct the computation graph for this loss function.

        Parameters
        ----------
        outputs : dict of Theano expressions
            A dictionary mapping network output names to Theano expressions
            representing the outputs of a computation graph.

        Returns
        -------
        loss : Theano expression
            The values of the loss given the network output.