deepmorpheus/model.py
def validation_step(self, sentence, batch_idx):
        """Handles one single validation step, computes its loss and updates accuracy"""
        self.init_word_hidden()
        outputs = self.forward(sentence)
        # Shape: (sentence_len, 9, num_tag_output)

        loss = self.nll_loss(sentence, outputs)
        avg_acc, acc_by_tag = self.accuracy(sentence, outputs)

        return {'val_loss': loss, 'val_acc': avg_acc, 'acc_by_tag': acc_by_tag}
Handles one single validation step, computes its loss and updates accuracy
Handles one single validation step, computes its loss and updates accuracy
Handles one single validation step computes its loss and updates accuracy
def validation_step(self, sentence, batch_idx):
        self.init_word_hidden()
        outputs = self.forward(sentence)
        loss = self.nll_loss(sentence, outputs)
        avg_acc, acc_by_tag = self.accuracy(sentence, outputs)
        return {'val_loss': loss, 'val_acc': avg_acc, 'acc_by_tag': acc_by_tag}
def validation_step ( self , sentence , batch_idx ) : self . init_word_hidden ( ) outputs = self . forward ( sentence ) loss = self . nll_loss ( sentence , outputs ) avg_acc , acc_by_tag = self . accuracy ( sentence , outputs ) return { 'val_loss' : loss , 'val_acc' : avg_acc , 'acc_by_tag' : acc_by_tag }
Handles one single validation step, computes its loss and updates accuracy
Handles one single validation step computes its loss and updates accuracy
"""Handles one single validation step, computes its loss and updates accuracy""" # Shape: (sentence_len, 9, num_tag_output)
self
sentence
batch_idx