forked from tensorflow/ranking
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtfrbert_train_model.sh
More file actions
executable file
·24 lines (24 loc) · 997 Bytes
/
tfrbert_train_model.sh
File metadata and controls
executable file
·24 lines (24 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
#BERT_DIR="/home/peter/github/tensorflow/ranking/uncased_L-4_H-256_A-4_TF2" && \
BERT_DIR="/home/peter/github/tensorflow/ranking/uncased_L-12_H-768_A-12_TF2" && \
OUTPUT_DIR="/tmp/tfr/model-petertoy-bertbase/" && \
DATA_DIR="/home/peter/github/peter-ranking/ranking" && \
rm -rf "${OUTPUT_DIR}" && \
bazel build -c opt \
tensorflow_ranking/extension/examples:tfrbert_example_py_binary && \
./bazel-bin/tensorflow_ranking/extension/examples/tfrbert_example_py_binary \
--train_input_pattern=${DATA_DIR}/train.toy.elwc.tfrecord \
--eval_input_pattern=${DATA_DIR}/eval.toy.elwc.tfrecord \
--bert_config_file=${BERT_DIR}/bert_config.json \
--bert_init_ckpt=${BERT_DIR}/bert_model.ckpt \
--bert_max_seq_length=128 \
--model_dir="${OUTPUT_DIR}" \
--list_size=15 \
--loss=softmax_loss \
--train_batch_size=1 \
--eval_batch_size=1 \
--learning_rate=1e-5 \
--num_train_steps=500 \
--num_eval_steps=10 \
--checkpoint_secs=500 \
--num_checkpoints=2