0db408d1eea2ce5c1d9b20fe61cb519e059d6cef,examples/basic_tagger.py,,main,#Any#Any#,23

Before Change


        trainer.dropout_decay = 0.
        trainer.each_epoch.append(
            lambda: print(model.evaluate(dev_X, dev_y)))
        for X, y in trainer.iterate(train_X, train_y):
            y = model.ops.flatten(y)
            yh, backprop = model.begin_update(X, drop=trainer.dropout)
            d_loss, loss = categorical_crossentropy(yh, y)
            optimizer.set_loss(loss)
            backprop(d_loss, optimizer)
    with model.use_params(optimizer.averages):
        print(model.evaluate(dev_X, dev_y))
 

After Change


    dev_X, dev_y = zip(*check_data)
    nb_class = max(max(y) for y in train_y)+1
    train_y = [to_categorical(y, nb_classes=nb_class) for y in train_y]
    dev_y = [to_categorical(y, nb_classes=nb_class) for y in dev_y]
    with model.begin_training(train_X, train_y) as (trainer, optimizer):
        trainer.each_epoch.append(
            lambda: print(model.evaluate(dev_X, dev_y)))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: explosion/thinc
Commit Name: 0db408d1eea2ce5c1d9b20fe61cb519e059d6cef
Time: 2017-09-15
Author: honnibal+gh@gmail.com
File Name: examples/basic_tagger.py
Class Name:
Method Name: main


Project Name: explosion/thinc
Commit Name: cc8d7ba5562cb2335d975b67e88a81a6bc9b0f46
Time: 2020-01-12
Author: honnibal+gh@gmail.com
File Name: thinc/loss.py
Class Name:
Method Name: categorical_crossentropy


Project Name: explosion/thinc
Commit Name: 58ed30d48a5daca11d073e5b1e6936309495312f
Time: 2017-02-01
Author: honnibal+gh@gmail.com
File Name: examples/mnist_mlp.py
Class Name:
Method Name: main