-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathadvanced-vis-sem-attention-train.sh
executable file
·56 lines (50 loc) · 1.92 KB
/
advanced-vis-sem-attention-train.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# the script directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
INCEPTION_CHECKPOINT="${DIR}/pretrained_model/inception_v3/inception_v3.ckpt"
TFRECORD_DIR="${DIR}/data/TFRecord_data"
MODEL_DIR="${DIR}/model"
model=ShowAndTellAdvancedModel
model_dir_name=show_and_tell_advanced_model_new_vis_sem_attention
cd im2txt
CUDA_VISIBLE_DEVICES=0 python train.py \
--input_file_pattern="${TFRECORD_DIR}/train-?????-of-?????.tfrecord" \
--inception_checkpoint_file="${INCEPTION_CHECKPOINT}" \
--train_dir="${MODEL_DIR}/${model_dir_name}" \
--model=${model} \
--initial_learning_rate=1.0 \
--learning_rate_decay_factor=0.66 \
--inception_return_tuple=True \
--use_scheduled_sampling=False \
--use_attention_wrapper=True \
--attention_mechanism=BahdanauAttention \
--num_lstm_layers=1 \
--predict_words_via_image_output=True \
--use_semantic_attention=True \
--semantic_attention_type="topk" \
--semantic_attention_topk_word=10 \
--use_separate_embedding_for_semantic_attention=True \
--semantic_attention_word_hash_depth=128 \
--support_ingraph=True \
--number_of_steps=30000
CUDA_VISIBLE_DEVICES=0 python train.py \
--input_file_pattern="${TFRECORD_DIR}/train-?????-of-?????.tfrecord" \
--inception_checkpoint_file="${INCEPTION_CHECKPOINT}" \
--train_dir="${MODEL_DIR}/${model_dir_name}" \
--model=${model} \
--initial_learning_rate=1.0 \
--learning_rate_decay_factor=0.66 \
--inception_return_tuple=True \
--use_scheduled_sampling=False \
--use_attention_wrapper=True \
--attention_mechanism=BahdanauAttention \
--num_lstm_layers=1 \
--predict_words_via_image_output=True \
--use_semantic_attention=True \
--semantic_attention_type="topk" \
--semantic_attention_topk_word=10 \
--use_separate_embedding_for_semantic_attention=True \
--semantic_attention_word_hash_depth=128 \
--support_ingraph=True \
--train_inception_with_decay=True \
--number_of_steps=600000