From b4f62df3fa9781d12552f8875165ba1f8e0e53f6 Mon Sep 17 00:00:00 2001 From: Harry Stuart <42882697+HStuart18@users.noreply.github.com> Date: Wed, 1 Jan 2020 15:49:17 +1100 Subject: [PATCH] Added DATA_DIR hyperparameter --- scripts/WGAN-GP.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/WGAN-GP.py b/scripts/WGAN-GP.py index e88cdde..7917e69 100644 --- a/scripts/WGAN-GP.py +++ b/scripts/WGAN-GP.py @@ -26,6 +26,8 @@ EPOCHS_PER_SAMPLE = 2 BATCH_SIZE = 16 Fs = 16000 +DATA_DIR = r"D:\ML_Datasets\mancini_piano\piano\train" + # Define class that contains GAN infrastructure class GAN: def __init__(self, model_dims=MODEL_DIMS, num_samples=NUM_SAMPLES, @@ -132,8 +134,8 @@ gan = GAN() # Create training data X_train = [] -for file in os.listdir(r"D:\ML_Datasets\mancini_piano\piano\train"): - with open(r"D:\ML_Datasets\mancini_piano\piano\train" + fr"\{file}", "rb") as f: +for file in os.listdir(DATA_DIR): ### Modify for your data directory + with open(DATA_DIR + fr"\{file}", "rb") as f: samples, _ = librosa.load(f, Fs) # Pad short audio files to NUM_SAMPLES duration if len(samples) < NUM_SAMPLES: