c4610ff26a01a0622bc11dcac0f0812f05c56e0c,12_4_name_classify.py,,test,#,149

Before Change



        // transpose to make S(sequence) x B (batch)
        output = classifier(input.t(), seq_lengths)
        print(i, output.size())
        print(target.size())

        pred = output.data.max(1, keepdim=True)[1]
        correct += pred.eq(target.data.view_as(pred)).cpu().sum()

After Change


    if name:
        input, seq_lengths, target = make_variables([name], [])
        output = classifier(input, seq_lengths)
        pred = output.data.max(1, keepdim=True)[1]
        country_id = pred.cpu().numpy()[0][0]
        print(name, "is", train_dataset.get_country(country_id))
        return

    print("evaluating trained model ...")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: hunkim/PyTorchZeroToAll
Commit Name: c4610ff26a01a0622bc11dcac0f0812f05c56e0c
Time: 2017-11-02
Author: hunkim@gmail.com
File Name: 12_4_name_classify.py
Class Name:
Method Name: test


Project Name: geekcomputers/Python
Commit Name: e1c4e6a7c7db68e123d978bfc56feb057898935f
Time: 2019-10-24
Author: kostasdedesar@penguin
File Name: Counting-sort.py
Class Name:
Method Name:


Project Name: kk7nc/RMDL
Commit Name: 97366d9bd109d1c04ca8dd7e8e2696463d4d8ac7
Time: 2018-06-04
Author: kk7nc@virginia.edu
File Name: RMDL/RMDL_Text.py
Class Name:
Method Name: Text_Classification


Project Name: openeventdata/mordecai
Commit Name: 834340875d6baae452eaf527443025c356a621d2
Time: 2017-11-19
Author: ahalterman0@gmail.com
File Name: mordecai/geoparse.py
Class Name: Geoparse
Method Name: geoparse