(self, batch, compute_predictions=False)
return loss_val, predictions
NOTE: batch must have the following attributes:
            inputs_word, inputs_char, labels
NOTE: batch must have the following attributes:
            inputs_word, inputs_char, labels
NOTE : batch must have the following attributes : inputs_word inputs_char labels
def loss(self, batch, compute_predictions=False):
        """
        NOTE: batch must have the following attributes:
            inputs_word, inputs_char, labels
        """
        hidden = self._embed_compute(batch)
        predictions = None
        if compute_predictions:
            predictions = self.output_layer(hidden)

        loss_val = self.output_layer.loss(hidden, batch.labels)

        return loss_val, predictions
def loss ( self , batch , compute_predictions = False ) : hidden = self . _embed_compute ( batch ) predictions = None if compute_predictions : predictions = self . output_layer ( hidden ) loss_val = self . output_layer . loss ( hidden , batch . labels ) return loss_val , predictions