aeb516494daa207720b428072ab49eeea7bfff75,scripts/text_generation/sequence_sampling.py,,,#,33

Before Change


parser = argparse.ArgumentParser(description="Generate sentences by beam search. "
                                             "We load a LSTM model that is pre-trained on "
                                             "WikiText as our encoder.")
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument("--use-sampling", action="store_true",
                   help="Use sampling instead of beam search.")
group.add_argument("--use-beam-search", action="store_true",
                   help="Use beam search instead of random sampling.")
parser.add_argument("--lm_model", type=str, default="awd_lstm_lm_1150",
                    help="type of the pre-trained model to load, can be "standard_lstm_lm_200", "

After Change


if args.gpu is not None and args.gpu < mx.context.num_gpus():
    ctx = mx.gpu(args.gpu)
else:
    if args.gpu:
        print("Specified GPU id {} does not exist. Available //GPUs: {}. Using CPU instead."\
                .format(args.gpu, mx.context.num_gpus()))
    ctx = mx.cpu()

assert 0 < args.print_num <= args.beam_size,\
    "print_num must be between {} and {}, received={}".format(1, args.beam_size, args.print_num)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: dmlc/gluon-nlp
Commit Name: aeb516494daa207720b428072ab49eeea7bfff75
Time: 2019-06-13
Author: xshiab@ust.hk
File Name: scripts/text_generation/sequence_sampling.py
Class Name:
Method Name:


Project Name: Picovoice/porcupine
Commit Name: bb900faca99e91a5466604462bd9979ee02b9d47
Time: 2019-10-09
Author: alireza@picovoice.ai
File Name: demo/python/porcupine_demo_offline.py
Class Name:
Method Name:


Project Name: dmlc/gluon-nlp
Commit Name: aeb516494daa207720b428072ab49eeea7bfff75
Time: 2019-06-13
Author: xshiab@ust.hk
File Name: scripts/text_generation/sequence_sampling.py
Class Name:
Method Name:


Project Name: AlexEMG/DeepLabCut
Commit Name: 8f21597f5113a909dcc9a3e886846609425de783
Time: 2019-07-14
Author: amathis@fas.harvard.edu
File Name: deeplabcut/pose_estimation_tensorflow/train.py
Class Name:
Method Name: