-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
37 lines (33 loc) · 821 Bytes
/
run.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
#!/usr/bin/env bash
data="./data"
checkpoints="checkpoints"
vocab_dir=${data}/vocab
json_poem=${data}/json_poem
corpus_dir=${data}/corpus
utils="./utils"
function clean_dir(){
_dir=$1
[ -d ${_dir} ] && rm -rf ${_dir} && mkdir ${_dir}
}
clean_dir ${vocab_dir}
clean_dir ${corpus_dir}
#cat $txt | python clean.py > $json_poem
#make_vocab
cat $json_poem | python ${utils}/make_vocab.py \
--dir $vocab_dir
#make_corpus
cat $json_poem | \
python ${utils}/make_corpus.py \
--corpus_file ${corpus_dir}/corpus.title \
--vocab_file ${vocab_dir}/vocab.title
#wgan model train
python wgan.py \
--type "train" \
--batchsize 1 \
--input ${corpus_dir}/corpus.title \
--vocab ${vocab_dir}/vocab.title \
--epochs 30 \
--learning_rate_G 1e-6 \
--learning_rate_D 1e-3 \
--save_dir ./save
#wgan model predict