提交 0df8af99 编写于 作者: W wangyang59

gan working on mnist

上级 3ebf6aaf
...@@ -36,9 +36,9 @@ s2, s4 = int(sample_dim/2), int(sample_dim/4), ...@@ -36,9 +36,9 @@ s2, s4 = int(sample_dim/2), int(sample_dim/4),
s8, s16 = int(sample_dim/8), int(sample_dim/16) s8, s16 = int(sample_dim/8), int(sample_dim/16)
settings( settings(
batch_size=100, batch_size=128,
learning_rate=1e-4, learning_rate=2e-4,
learning_method=AdamOptimizer() learning_method=AdamOptimizer(beta1=0.5)
) )
def conv_bn(input, channels, imgSize, num_filters, output_x, stride, name, def conv_bn(input, channels, imgSize, num_filters, output_x, stride, name,
......
...@@ -88,7 +88,7 @@ def load_mnist_data(imageFile): ...@@ -88,7 +88,7 @@ def load_mnist_data(imageFile):
for i in range(n): for i in range(n):
pixels = [] pixels = []
for j in range(28 * 28): for j in range(28 * 28):
pixels.append(float(ord(f.read(1))) / 255.0) pixels.append(float(ord(f.read(1))) / 255.0 * 2.0 - 1.0)
data[i, :] = pixels data[i, :] = pixels
f.close() f.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册