Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
DATASET_PATH=${DATASET_PATH:-"sample/seq_dataset.pkl"}
BP="result/rnn/$(date '+%Y%m%d-%H%M%S')"
BASE_PATH=${BASE_PATH:-$BP}
MODEL_PATH="${BASE_PATH}/seq_model.pkl"
SAMPLING_PATH="${BASE_PATH}/seq_sample.txt"
FIGURE_PATH="${BASE_PATH}/figure.png"
if [ ! -e "$DATASET_PATH" ]; then
mkdir -p $(dirname "$DATASET_PATH")
echo "creating dataset to $DATASET_PATH"
python src/rnn/gen_dataset.py --dataset "$DATASET_PATH" --n 10000
fi
if [ ! -e "$MODEL_PATH" ]; then
mkdir -p $(dirname "$MODEL_PATH")
echo "learning to $MODEL_PATH"
python src/rnn/gen_model.py --dataset "$DATASET_PATH" --model "$MODEL_PATH" $@
rm -f "$SAMPLING_PATH"
fi
if [ ! -e "$SAMPLING_PATH" ]; then
mkdir -p $(dirname "$SAMPLING_PATH")
echo "sampling to $SAMPLING_PATH"
python src/rnn/sampling_with_model.py --model "$MODEL_PATH" --sample "$SAMPLING_PATH" --n 10000
fi
mkdir -p $(dirname "$FIGURE_PATH")
echo "comparing"
python src/rnn/compare_data.py --dataset "$DATASET_PATH" --sample "$SAMPLING_PATH" --figure "$FIGURE_PATH"
echo "see result: $FIGURE_PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.