7681e0305184eaf164069485003ab8c6e3e5e155,scripts/bert/finetune_classifier.py,,,#,48

Before Change


from tokenizer import FullTokenizer
from dataset import MRPCDataset, ClassificationTransform

np.random.seed(0)
random.seed(0)
mx.random.seed(2)
logging.getLogger().setLevel(logging.DEBUG)

After Change


batch_size = args.batch_size
dev_batch_size = args.dev_batch_size
lr = args.lr
accumulate = args.accumulate
log_interval = args.log_interval * accumulate if accumulate else args.log_interval
if accumulate:
    logging.info("Using gradient accumulation. Effective batch size = %d"%(accumulate*batch_size))

// random seed
np.random.seed(args.seed)
random.seed(args.seed)
mx.random.seed(args.seed)

ctx = mx.cpu() if not args.gpu else mx.gpu()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: dmlc/gluon-nlp
Commit Name: 7681e0305184eaf164069485003ab8c6e3e5e155
Time: 2018-12-29
Author: linhaibin.eric@gmail.com
File Name: scripts/bert/finetune_classifier.py
Class Name:
Method Name:


Project Name: dmlc/gluon-nlp
Commit Name: 7681e0305184eaf164069485003ab8c6e3e5e155
Time: 2018-12-29
Author: linhaibin.eric@gmail.com
File Name: scripts/bert/finetune_classifier.py
Class Name:
Method Name: