Commit d315be6f authored by Pietro Morerio's avatar Pietro Morerio
Browse files

speckle experiment

parent 77405cab
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -18,7 +18,7 @@ def show_batch(batch):
def add_defect(image):
# pepper noise only
#~ image = random_noise(image, mode='pepper', seed=1234)
image = random_noise(image, mode='speckle', mean=-0.01, var = 0.001, seed=1234)
image = random_noise(image, mode='speckle', mean=-0.1, var = 0.01, seed=1234)
return image
......
......@@ -7,12 +7,12 @@ from dataset import BatchGenerator, MyBatchGenerator, get_mnist
from model import *
flags.DEFINE_integer('batch_size', 128, 'Batch size.')
flags.DEFINE_integer('train_iter', 30000, 'Total training iter')
flags.DEFINE_integer('train_iter', 100000, 'Total training iter')
flags.DEFINE_integer('step', 500, 'Save after ... iteration')
mnist = get_mnist()
#~ gen = BatchGenerator(mnist.train.images, mnist.train.labels)
gen = MyBatchGenerator(mnist.train.images, mnist.train.labels, num_classes=5)
gen = MyBatchGenerator(mnist.train.images, mnist.train.labels, num_classes=10)
test_im = np.array([im.reshape((28,28,1)) for im in mnist.test.images])
c = ['#ff0000', '#ffff00', '#00ff00', '#00ffff', '#0000ff', '#ff00ff', '#990000', '#999900', '#009900', '#009999']
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment