d63abb86304d5ceca8ec14109a4812258f9839ea,scripts/bert/finetune_classifier.py,,evaluate,#Any#Any#Any#,544

Before Change


        input_ids, valid_len, type_ids, label = seqs
        out = model(
            input_ids.as_in_context(ctx), type_ids.as_in_context(ctx),
            valid_len.astype("float32").as_in_context(ctx))
        ls = loss_function(out, label.as_in_context(ctx)).mean()

        step_loss += ls.asscalar()

After Change


        valid_length = valid_length.as_in_context(ctx).astype("float32")
        label = label.as_in_context(ctx)
        if use_roberta:
            out = model(input_ids, valid_length)
        else:
            out = model(input_ids, segment_ids.as_in_context(ctx), valid_length)
        ls = loss_function(out, label).mean()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: dmlc/gluon-nlp
Commit Name: d63abb86304d5ceca8ec14109a4812258f9839ea
Time: 2019-09-24
Author: linhaibin.eric@gmail.com
File Name: scripts/bert/finetune_classifier.py
Class Name:
Method Name: evaluate


Project Name: dmlc/gluon-nlp
Commit Name: d63abb86304d5ceca8ec14109a4812258f9839ea
Time: 2019-09-24
Author: linhaibin.eric@gmail.com
File Name: scripts/bert/finetune_classifier.py
Class Name:
Method Name: test


Project Name: keras-team/autokeras
Commit Name: f4503bb3a3be014b452f54d8e2d187bb6419f627
Time: 2018-08-01
Author: jhfjhfj1@gmail.com
File Name: autokeras/classifier.py
Class Name: ImageClassifier
Method Name: predict