提交 683b7780 编写于 作者: Z zhengya01

add gru4rec ce

上级 d47f10fe
......@@ -4,13 +4,19 @@ export MKL_NUM_THREADS=1
export OMP_NUM_THREADS=1
export CPU_NUM=1
export NUM_THREADS=1
FLAGS_benchmark=true python train.py --train_dir train_big_data --vocab_path vocab_big.txt --use_cuda 0 --batch_size 500 --model_dir model_output --pass_num 2 --enable_ce --step_num 10 | python _ce.py
cudaid=${tagspace:=0} # use 0-th card as default
export CUDA_VISIBLE_DEVICES=$cudaid
FLAGS_benchmark=true python train.py --train_dir train_big_data --vocab_path vocab_big.txt --use_cuda 1 --batch_size 500 --model_dir model_output --pass_num 2 --enable_ce | python _ce.py
FLAGS_benchmark=true python train.py --train_dir train_big_data --vocab_path vocab_big.txt --use_cuda 1 --batch_size 500 --model_dir model_output --pass_num 2 --enable_ce --step_num 1000 | python _ce.py
cudaid=${tagspace_4:=0,1,2,3} # use 0-th card as default
export CUDA_VISIBLE_DEVICES=$cudaid
FLAGS_benchmark=true python train.py --train_dir train_big_data --vocab_path vocab_big.txt --use_cuda 1 --parallel 1 --num_devices 2 --batch_size 500 --model_dir model_output --pass_num 2 --enable_ce | python _ce.py
FLAGS_benchmark=true python train.py --train_dir train_big_data --vocab_path vocab_big.txt --use_cuda 1 --parallel 1 --num_devices 2 --batch_size 500 --model_dir model_output --pass_num 2 --enable_ce --step_num 1000 | python _ce.py
......@@ -8,12 +8,16 @@ from kpi import DurationKpi
from kpi import AccKpi
each_pass_duration_cpu1_thread1_kpi = DurationKpi('each_pass_duration_cpu1_thread1', 0.08, 0, actived=True)
train_ppl_cpu1_thread1_kpi = CostKpi('train_ppl_cpu1_thread1', 0.08, 0)
each_pass_duration_gpu1_kpi = DurationKpi('each_pass_duration_gpu1', 0.08, 0, actived=True)
train_ppl_gpu1_kpi = CostKpi('train_ppl_gpu1', 0.08, 0)
each_pass_duration_gpu4_kpi = DurationKpi('each_pass_duration_gpu4', 0.08, 0, actived=True)
train_ppl_gpu4_kpi = CostKpi('train_ppl_gpu4', 0.08, 0)
tracking_kpis = [
each_pass_duration_cpu1_thread1_kpi,
train_ppl_cpu1_thread1_kpi,
each_pass_duration_gpu1_kpi,
train_ppl_gpu1_kpi,
each_pass_duration_gpu4_kpi,
......
......@@ -40,6 +40,8 @@ def parse_args():
'--base_lr', type=float, default=0.01, help='learning rate')
parser.add_argument(
'--num_devices', type=int, default=1, help='Number of GPU devices')
parser.add_argument(
'--step_num', type=int, default=1000, help='Number of steps')
parser.add_argument(
'--enable_ce',
action='store_true',
......@@ -116,7 +118,7 @@ def train():
ce_info.append(newest_ppl)
if i % args.print_batch == 0:
print("step:%d ppl:%.3f" % (i, newest_ppl))
if args.enable_ce and i > 1000:
if args.enable_ce and i > args.step_num:
break
t1 = time.time()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册