Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
5aa59796
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5aa59796
编写于
11月 29, 2016
作者:
W
wangyang59
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes on demo/gan following lzhao4ever comments
上级
531e8354
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
10 deletion
+8
-10
demo/gan/README.md
demo/gan/README.md
+2
-1
demo/gan/data/get_mnist_data.sh
demo/gan/data/get_mnist_data.sh
+1
-1
demo/gan/gan_conf.py
demo/gan/gan_conf.py
+1
-1
demo/gan/gan_trainer.py
demo/gan/gan_trainer.py
+4
-7
未找到文件。
demo/gan/README.md
浏览文件 @
5aa59796
...
...
@@ -9,4 +9,5 @@ Then you can run the command below. The flag -d specifies the training data (cif
$python gan_trainer.py -d cifar --useGpu 1
The generated images will be stored in ./cifar_samples/
\ No newline at end of file
The generated images will be stored in ./cifar_samples/
The corresponding models will be stored in ./cifar_params/
\ No newline at end of file
demo/gan/data/get_mnist_data.sh
浏览文件 @
5aa59796
#!/usr/bin/env sh
# This script
s
downloads the mnist data and unzips it.
# This script downloads the mnist data and unzips it.
set
-e
DIR
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
;
pwd
-P
)
"
rm
-rf
"
$DIR
/mnist_data"
...
...
demo/gan/gan_conf.py
浏览文件 @
5aa59796
...
...
@@ -38,7 +38,7 @@ sample_dim = 2
settings
(
batch_size
=
128
,
learning_rate
=
1e-4
,
learning_method
=
AdamOptimizer
(
beta1
=
0.
7
)
learning_method
=
AdamOptimizer
(
beta1
=
0.
5
)
)
def
discriminator
(
sample
):
...
...
demo/gan/gan_trainer.py
浏览文件 @
5aa59796
...
...
@@ -87,11 +87,8 @@ def load_mnist_data(imageFile):
else
:
n
=
10000
data
=
numpy
.
zeros
((
n
,
28
*
28
),
dtype
=
"float32"
)
for
i
in
range
(
n
):
pixels
=
numpy
.
fromfile
(
f
,
'ubyte'
,
count
=
28
*
28
)
data
[
i
,
:]
=
pixels
/
255.0
*
2.0
-
1.0
data
=
numpy
.
fromfile
(
f
,
'ubyte'
,
count
=
n
*
28
*
28
).
reshape
((
n
,
28
*
28
))
data
=
data
/
255.0
*
2.0
-
1.0
f
.
close
()
return
data
...
...
@@ -235,7 +232,7 @@ def main():
else
:
data_np
=
load_uniform_data
()
# this create a gradient machine for discriminator
# this create
s
a gradient machine for discriminator
dis_training_machine
=
api
.
GradientMachine
.
createFromConfigProto
(
dis_conf
.
model_config
)
# this create a gradient machine for generator
...
...
@@ -243,7 +240,7 @@ def main():
gen_conf
.
model_config
)
# generator_machine is used to generate data only, which is used for
# training discrinator
# training discri
mi
nator
logger
.
info
(
str
(
generator_conf
.
model_config
))
generator_machine
=
api
.
GradientMachine
.
createFromConfigProto
(
generator_conf
.
model_config
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录