From 5df56c99ddf82f4e48df570d407fb8ca678838cd Mon Sep 17 00:00:00 2001 From: Morvan Zhou Date: Fri, 15 Dec 2017 14:21:23 +1100 Subject: [PATCH] remove random seed --- tutorial-contents/301_regression.py | 2 +- tutorial-contents/302_classification.py | 2 +- tutorial-contents/304_save_reload.py | 2 +- tutorial-contents/306_optimizer.py | 2 +- tutorial-contents/401_CNN.py | 2 +- tutorial-contents/402_RNN_classifier.py | 2 +- tutorial-contents/403_RNN_regressor.py | 2 +- tutorial-contents/404_autoencoder.py | 2 +- tutorial-contents/406_GAN.py | 4 ++-- tutorial-contents/406_conditional_GAN.py | 4 ++-- tutorial-contents/501_why_torch_dynamic_graph.py | 2 +- tutorial-contents/502_GPU.py | 2 +- tutorial-contents/503_dropout.py | 2 +- tutorial-contents/504_batch_normalization.py | 4 ++-- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tutorial-contents/301_regression.py b/tutorial-contents/301_regression.py index 9745082..897d3e8 100644 --- a/tutorial-contents/301_regression.py +++ b/tutorial-contents/301_regression.py @@ -11,7 +11,7 @@ from torch.autograd import Variable import torch.nn.functional as F import matplotlib.pyplot as plt -torch.manual_seed(1) # reproducible +# torch.manual_seed(1) # reproducible x = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1) # x data (tensor), shape=(100, 1) y = x.pow(2) + 0.2*torch.rand(x.size()) # noisy y data (tensor), shape=(100, 1) diff --git a/tutorial-contents/302_classification.py b/tutorial-contents/302_classification.py index 54120bc..72ed82e 100644 --- a/tutorial-contents/302_classification.py +++ b/tutorial-contents/302_classification.py @@ -11,7 +11,7 @@ from torch.autograd import Variable import torch.nn.functional as F import matplotlib.pyplot as plt -torch.manual_seed(1) # reproducible +# torch.manual_seed(1) # reproducible # make fake data n_data = torch.ones(100, 2) diff --git a/tutorial-contents/304_save_reload.py b/tutorial-contents/304_save_reload.py index af0f425..1ba6e2e 100644 --- a/tutorial-contents/304_save_reload.py +++ b/tutorial-contents/304_save_reload.py @@ -10,7 +10,7 @@ import torch from torch.autograd import Variable import matplotlib.pyplot as plt -torch.manual_seed(1) # reproducible +# torch.manual_seed(1) # reproducible # fake data x = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1) # x data (tensor), shape=(100, 1) diff --git a/tutorial-contents/306_optimizer.py b/tutorial-contents/306_optimizer.py index 4254d17..b961866 100644 --- a/tutorial-contents/306_optimizer.py +++ b/tutorial-contents/306_optimizer.py @@ -12,7 +12,7 @@ import torch.nn.functional as F from torch.autograd import Variable import matplotlib.pyplot as plt -torch.manual_seed(1) # reproducible +# torch.manual_seed(1) # reproducible LR = 0.01 BATCH_SIZE = 32 diff --git a/tutorial-contents/401_CNN.py b/tutorial-contents/401_CNN.py index 0907061..77b1693 100644 --- a/tutorial-contents/401_CNN.py +++ b/tutorial-contents/401_CNN.py @@ -19,7 +19,7 @@ import torch.utils.data as Data import torchvision import matplotlib.pyplot as plt -torch.manual_seed(1) # reproducible +# torch.manual_seed(1) # reproducible # Hyper Parameters EPOCH = 1 # train the training data n times, to save time, we just train 1 epoch diff --git a/tutorial-contents/402_RNN_classifier.py b/tutorial-contents/402_RNN_classifier.py index 909481a..27f6080 100644 --- a/tutorial-contents/402_RNN_classifier.py +++ b/tutorial-contents/402_RNN_classifier.py @@ -15,7 +15,7 @@ import torchvision.transforms as transforms import matplotlib.pyplot as plt -torch.manual_seed(1) # reproducible +# torch.manual_seed(1) # reproducible # Hyper Parameters EPOCH = 1 # train the training data n times, to save time, we just train 1 epoch diff --git a/tutorial-contents/403_RNN_regressor.py b/tutorial-contents/403_RNN_regressor.py index 8563d45..2a151ec 100644 --- a/tutorial-contents/403_RNN_regressor.py +++ b/tutorial-contents/403_RNN_regressor.py @@ -13,7 +13,7 @@ from torch.autograd import Variable import numpy as np import matplotlib.pyplot as plt -torch.manual_seed(1) # reproducible +# torch.manual_seed(1) # reproducible # Hyper Parameters TIME_STEP = 10 # rnn time step diff --git a/tutorial-contents/404_autoencoder.py b/tutorial-contents/404_autoencoder.py index 877dd86..0d83ca9 100644 --- a/tutorial-contents/404_autoencoder.py +++ b/tutorial-contents/404_autoencoder.py @@ -18,7 +18,7 @@ from matplotlib import cm import numpy as np -torch.manual_seed(1) # reproducible +# torch.manual_seed(1) # reproducible # Hyper Parameters EPOCH = 10 diff --git a/tutorial-contents/406_GAN.py b/tutorial-contents/406_GAN.py index 22ae2a2..3f726d2 100644 --- a/tutorial-contents/406_GAN.py +++ b/tutorial-contents/406_GAN.py @@ -13,8 +13,8 @@ from torch.autograd import Variable import numpy as np import matplotlib.pyplot as plt -torch.manual_seed(1) # reproducible -np.random.seed(1) +# torch.manual_seed(1) # reproducible +# np.random.seed(1) # Hyper Parameters BATCH_SIZE = 64 diff --git a/tutorial-contents/406_conditional_GAN.py b/tutorial-contents/406_conditional_GAN.py index b86030a..903d766 100644 --- a/tutorial-contents/406_conditional_GAN.py +++ b/tutorial-contents/406_conditional_GAN.py @@ -13,8 +13,8 @@ from torch.autograd import Variable import numpy as np import matplotlib.pyplot as plt -torch.manual_seed(1) # reproducible -np.random.seed(1) +# torch.manual_seed(1) # reproducible +# np.random.seed(1) # Hyper Parameters BATCH_SIZE = 64 diff --git a/tutorial-contents/501_why_torch_dynamic_graph.py b/tutorial-contents/501_why_torch_dynamic_graph.py index 761bc54..e85d664 100644 --- a/tutorial-contents/501_why_torch_dynamic_graph.py +++ b/tutorial-contents/501_why_torch_dynamic_graph.py @@ -13,7 +13,7 @@ from torch.autograd import Variable import numpy as np import matplotlib.pyplot as plt -torch.manual_seed(1) # reproducible +# torch.manual_seed(1) # reproducible # Hyper Parameters INPUT_SIZE = 1 # rnn input size / image width diff --git a/tutorial-contents/502_GPU.py b/tutorial-contents/502_GPU.py index ba2d4e6..66ec1c1 100644 --- a/tutorial-contents/502_GPU.py +++ b/tutorial-contents/502_GPU.py @@ -12,7 +12,7 @@ from torch.autograd import Variable import torch.utils.data as Data import torchvision -torch.manual_seed(1) +# torch.manual_seed(1) EPOCH = 1 BATCH_SIZE = 50 diff --git a/tutorial-contents/503_dropout.py b/tutorial-contents/503_dropout.py index 88b0351..aa36a72 100644 --- a/tutorial-contents/503_dropout.py +++ b/tutorial-contents/503_dropout.py @@ -10,7 +10,7 @@ import torch from torch.autograd import Variable import matplotlib.pyplot as plt -torch.manual_seed(1) # reproducible +# torch.manual_seed(1) # reproducible N_SAMPLES = 20 N_HIDDEN = 300 diff --git a/tutorial-contents/504_batch_normalization.py b/tutorial-contents/504_batch_normalization.py index 4bcf01d..aa25e2f 100644 --- a/tutorial-contents/504_batch_normalization.py +++ b/tutorial-contents/504_batch_normalization.py @@ -16,8 +16,8 @@ import torch.nn.functional as F import matplotlib.pyplot as plt import numpy as np -torch.manual_seed(1) # reproducible -np.random.seed(1) +# torch.manual_seed(1) # reproducible +# np.random.seed(1) # Hyper parameters N_SAMPLES = 2000