b11c3f046b24cb864190bf0e9b1506f80138b9c4,cube/generic_networks/tokenizers.py,TieredTokenizer,end_batch,#TieredTokenizer#,147

Before Change


    def end_batch(self):
        total_loss_ss = dy.esum(self.losses)
        total_loss_tok = dy.esum(self.losses_tok)
        total_loss_val = total_loss_ss.value() + total_loss_tok.value()
        total_loss_ss.backward()
        total_loss_tok.backward()
        self.trainerSS.update()

After Change



    def end_batch(self):
        total_loss_val = 0
        if len(self.losses) > 0:
            total_loss_ss = dy.esum(self.losses)
            total_loss_val += total_loss_ss.value()
            total_loss_ss.backward()
            self.trainerSS.update()

        if len(self.losses_tok):
            total_loss_tok = dy.esum(self.losses_tok)
            total_loss_val += total_loss_tok.value()
            total_loss_tok.backward()
            self.trainerTok.update()
        return total_loss_val
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: adobe/NLP-Cube
Commit Name: b11c3f046b24cb864190bf0e9b1506f80138b9c4
Time: 2018-03-26
Author: boros@adobe.com
File Name: cube/generic_networks/tokenizers.py
Class Name: TieredTokenizer
Method Name: end_batch


Project Name: interactiveaudiolab/nussl
Commit Name: 441a175deaa5812c086cdb8a3939d51d39f5a7ae
Time: 2020-01-26
Author: prem@u.northwestern.edu
File Name: nussl/deep/train/trainer.py
Class Name: Trainer
Method Name: setup_loss


Project Name: drckf/paysage
Commit Name: 8181decb9e11d15ed63f314bf5efc48475b045e5
Time: 2017-03-25
Author: jrwalsh1@gmail.com
File Name: paysage/layers.py
Class Name: Layer
Method Name: get_penalties