Created
January 24, 2016 05:08
-
-
Save mokemokechicken/974ab2b35b35716bca53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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