4b4946f40ef0f8c533f5473ec3756e639e57e5c5,python/baseline/dy/dynety.py,,show_examples_dynet,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,487

Before Change


        tgt_array = tgt_array[0:max_examples]
        src_len = src_len[0:max_examples]

    for src_len_i, src_i, tgt_i in zip(src_len, src_array, tgt_array):

        print("========================================================================")
        src_len_i = np.array(src_len_i, ndmin=1)
        sent = lookup_sentence(rlut1, src_i, reverse=reverse)
        print("[OP] %s" % sent)
        sent = lookup_sentence(rlut2, tgt_i)
        print("[Actual] %s" % sent)
        src_dict = {"src": src_i.reshape(1, -1), "src_len": src_len_i}
        dst_i = model.run(src_dict)[0]
        sent = lookup_sentence(rlut2, dst_i)
        print("Guess: %s" % sent)
        print("------------------------------------------------------------------------")

After Change


    for i in range(max_examples):
        example = {}
        // Batch first, so this gets a single example at once
        for k, value in batch_dict.items():
            v = value[i]
            example[k] = v.reshape((1,) + v.shape)

        print("========================================================================")
        sent = lookup_sentence(rlut1, example[src_field].squeeze(), reverse=reverse)
        print("[OP] %s" % sent)
        sent = lookup_sentence(rlut2, example["tgt"].squeeze())
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: dpressel/mead-baseline
Commit Name: 4b4946f40ef0f8c533f5473ec3756e639e57e5c5
Time: 2018-09-28
Author: dpressel@gmail.com
File Name: python/baseline/dy/dynety.py
Class Name:
Method Name: show_examples_dynet


Project Name: analysiscenter/batchflow
Commit Name: 222491435716cc587bde288964d65061847ecfc1
Time: 2018-05-04
Author: a.kozhevin@analysiscenter.ru
File Name: dataset/research/workers.py
Class Name: PipelineWorker
Method Name: run_job


Project Name: pantsbuild/pants
Commit Name: bf9599809214cbc3082eb7f39c0ad3155822a2c5
Time: 2014-02-12
Author: benjy@foursquare.com
File Name: src/python/twitter/pants/tasks/jvm_compile/scala/zinc_analysis.py
Class Name: ZincAnalysis
Method Name: split


Project Name: explosion/thinc
Commit Name: f2754e0656d8cebe1f785f6af100e4ade241a7f8
Time: 2020-01-14
Author: honnibal+gh@gmail.com
File Name: thinc/model.py
Class Name: Model
Method Name: from_bytes