6132a909409f3bb8217c43a00cbf6777115b3608,theanolm/commands/train.py,,train,#Any#,187

Before Change


            theano.printing.debugprint(optimizer.gradient_update_function)

        print("Building text scorer.")
        sys.stdout.flush()
        scorer = TextScorer(network, ignore_unk, unk_penalty, args.profile)
        validation_mmap = mmap.mmap(args.validation_file.fileno(),
                                    0,
                                    prot=mmap.PROT_READ)

After Change



        trainer.initialize(network, state, optimizer)

        if not args.validation_file is None:
            print("Building text scorer for cross-validation.")
            sys.stdout.flush()
            scorer = TextScorer(network, ignore_unk, unk_penalty, args.profile)
            print("Validation text:", args.validation_file.name)
            validation_mmap = mmap.mmap(args.validation_file.fileno(),
                                        0,
                                        prot=mmap.PROT_READ)
            validation_iter = \
                LinearBatchIterator(validation_mmap,
                                    vocabulary,
                                    batch_size=args.batch_size,
                                    max_sequence_length=None)
            trainer.set_validation(validation_iter, scorer)
        else:
            validation_iter = None

        print("Training neural network.")
        sys.stdout.flush()
        trainer.train()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: senarvi/theanolm
Commit Name: 6132a909409f3bb8217c43a00cbf6777115b3608
Time: 2016-11-22
Author: seppo.git@marjaniemi.com
File Name: theanolm/commands/train.py
Class Name:
Method Name: train


Project Name: GRAAL-Research/pytoune
Commit Name: dc8136f5821d4840fb99d4d75027107fdf1e11cd
Time: 2018-06-22
Author: fredy_14@live.fr
File Name: pytoune/framework/callbacks/progress.py
Class Name: ProgressionCallback
Method Name: on_batch_end


Project Name: pyprob/pyprob
Commit Name: a2c7915dc8f072b7beed11b6cfad181746c0188b
Time: 2019-02-25
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/nn/inference_network.py
Class Name: InferenceNetwork
Method Name: optimize


Project Name: Shmuma/ptan
Commit Name: 1e18489ec84dfa1d16303ac87d9f8c2299b5f4bb
Time: 2018-08-01
Author: max.lapan@gmail.com
File Name: ptan/common/utils.py
Class Name: RewardTracker
Method Name: reward