GeezerVison is showing github.com — Always load the data from the data folder. · ooitomato/DeepLearningTutorials@c475870
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: code/DBN.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -257,7 +257,7 @@ def test_score(): | 257 | 257 |
| 258 | 258 | def test_DBN(finetune_lr=0.1, pretraining_epochs=100, | 259 | 259 | pretrain_lr=0.01, k=1, training_epochs=1000, | 260 | | - dataset='../data/mnist.pkl.gz', batch_size=10): | | 260 | + dataset='mnist.pkl.gz', batch_size=10): | 261 | 261 | """ | 262 | 262 | Demonstrates how to train and test a Deep Belief Network. | 263 | 263 |
| |
Collapse file Copy file name to clipboardExpand all lines: code/SdA.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -295,7 +295,7 @@ def test_score(): | 295 | 295 |
| 296 | 296 | def test_SdA(finetune_lr=0.1, pretraining_epochs=15, | 297 | 297 | pretrain_lr=0.001, training_epochs=1000, | 298 | | - dataset='../data/mnist.pkl.gz', batch_size=1): | | 298 | + dataset='mnist.pkl.gz', batch_size=1): | 299 | 299 | """ | 300 | 300 | Demonstrates how to train and test a stochastic denoising autoencoder. | 301 | 301 |
| |
Collapse file Copy file name to clipboardExpand all lines: code/cA.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -221,7 +221,7 @@ def get_cost_updates(self, contraction_level, learning_rate): | 221 | 221 |
| 222 | 222 |
| 223 | 223 | def test_cA(learning_rate=0.01, training_epochs=20, | 224 | | - dataset='../data/mnist.pkl.gz', | | 224 | + dataset='mnist.pkl.gz', | 225 | 225 | batch_size=10, output_folder='cA_plots', contraction_level=.1): | 226 | 226 | """ | 227 | 227 | This demo is tested on MNIST | |
Collapse file Copy file name to clipboardExpand all lines: code/convolutional_mlp.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -104,7 +104,7 @@ def __init__(self, rng, input, filter_shape, image_shape, poolsize=(2, 2)): | 104 | 104 |
| 105 | 105 |
| 106 | 106 | def evaluate_lenet5(learning_rate=0.1, n_epochs=200, | 107 | | - dataset='../data/mnist.pkl.gz', | | 107 | + dataset='mnist.pkl.gz', | 108 | 108 | nkerns=[20, 50], batch_size=500): | 109 | 109 | """ Demonstrates lenet on MNIST dataset | 110 | 110 |
| |
Collapse file Copy file name to clipboardExpand all lines: code/dA.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -237,7 +237,7 @@ def get_cost_updates(self, corruption_level, learning_rate): | 237 | 237 |
| 238 | 238 |
| 239 | 239 | def test_dA(learning_rate=0.1, training_epochs=15, | 240 | | - dataset='../data/mnist.pkl.gz', | | 240 | + dataset='mnist.pkl.gz', | 241 | 241 | batch_size=20, output_folder='dA_plots'): | 242 | 242 |
| 243 | 243 | """ | |
Collapse file Copy file name to clipboardExpand all lines: code/logistic_cg.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -132,7 +132,7 @@ def errors(self, y): | 132 | 132 | raise NotImplementedError() | 133 | 133 |
| 134 | 134 |
| 135 | | -def cg_optimization_mnist(n_epochs=50, mnist_pkl_gz='../data/mnist.pkl.gz'): | | 135 | +def cg_optimization_mnist(n_epochs=50, mnist_pkl_gz='mnist.pkl.gz'): | 136 | 136 | """Demonstrate conjugate gradient optimization of a log-linear model | 137 | 137 |
| 138 | 138 | This is demonstrated on MNIST. | |
Collapse file Copy file name to clipboardExpand all lines: code/logistic_sgd.py +8-1Lines changed: 8 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -157,6 +157,13 @@ def load_data(dataset): | 157 | 157 |
| 158 | 158 | # Download the MNIST dataset if it is not present | 159 | 159 | data_dir, data_file = os.path.split(dataset) | | 160 | + if data_dir == "" and not os.path.isfile(dataset): | | 161 | + # Check if dataset is in the data directory. | | 162 | + new_path = os.path.join(os.path.split(os.path.split(__file__)[0])[0], | | 163 | + "data", dataset) | | 164 | + if os.path.isfile(new_path) or data_file == 'mnist.pkl.gz': | | 165 | + dataset = new_path | | 166 | + | 160 | 167 | if (not os.path.isfile(dataset)) and data_file == 'mnist.pkl.gz': | 161 | 168 | import urllib | 162 | 169 | origin = 'http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.pkl.gz' | @@ -211,7 +218,7 @@ def shared_dataset(data_xy, borrow=True): | 211 | 218 |
| 212 | 219 |
| 213 | 220 | def sgd_optimization_mnist(learning_rate=0.13, n_epochs=1000, | 214 | | - dataset='../data/mnist.pkl.gz', | | 221 | + dataset='mnist.pkl.gz', | 215 | 222 | batch_size=600): | 216 | 223 | """ | 217 | 224 | Demonstrate stochastic gradient descent optimization of a log-linear | |
Collapse file Copy file name to clipboardExpand all lines: code/mlp.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -174,7 +174,7 @@ def __init__(self, rng, input, n_in, n_hidden, n_out): | 174 | 174 |
| 175 | 175 |
| 176 | 176 | def test_mlp(learning_rate=0.01, L1_reg=0.00, L2_reg=0.0001, n_epochs=1000, | 177 | | - dataset='../data/mnist.pkl.gz', batch_size=20, n_hidden=500): | | 177 | + dataset='mnist.pkl.gz', batch_size=20, n_hidden=500): | 178 | 178 | """ | 179 | 179 | Demonstrate stochastic gradient descent optimization for a multilayer | 180 | 180 | perceptron | |
Collapse file Copy file name to clipboardExpand all lines: code/rbm.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -315,7 +315,7 @@ def get_reconstruction_cost(self, updates, pre_sigmoid_nv): | 315 | 315 |
| 316 | 316 |
| 317 | 317 | def test_rbm(learning_rate=0.1, training_epochs=15, | 318 | | - dataset='../data/mnist.pkl.gz', batch_size=20, | | 318 | + dataset='mnist.pkl.gz', batch_size=20, | 319 | 319 | n_chains=20, n_samples=10, output_folder='rbm_plots', | 320 | 320 | n_hidden=500): | 321 | 321 | """ | |
|