Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
5d23f241
You need to sign in or sign up before continuing.
Commit
5d23f241
authored
Jan 23, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix linting.
parent
19c6b446
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
examples/GAN/InfoGAN-mnist.py
examples/GAN/InfoGAN-mnist.py
+2
-2
tensorpack/tfutils/distributions.py
tensorpack/tfutils/distributions.py
+4
-0
No files found.
examples/GAN/InfoGAN-mnist.py
View file @
5d23f241
...
...
@@ -64,12 +64,12 @@ class Model(GANModelDesc):
GaussianDistribution
(
"uni_a"
,
1
),
GaussianDistribution
(
"uni_b"
,
1
)])
# prior: the assumption how the factors are presented in the dataset
prior
=
tf
.
constant
([
0.1
]
*
10
+
[
0
,
0
],
tf
.
float32
,
[
12
],
name
=
'prior'
)
prior
=
tf
.
constant
([
0.1
]
*
10
+
[
0
,
0
],
tf
.
float32
,
[
12
],
name
=
'prior'
)
batch_prior
=
tf
.
tile
(
tf
.
expand_dims
(
prior
,
0
),
[
BATCH
,
1
],
name
=
'batch_prior'
)
# sample the latent code zc:
sample
=
self
.
factors
.
dists
[
0
]
.
sample
(
BATCH
,
tf
.
constant
([
0.1
]
*
10
,
tf
.
float32
,
shape
=
[
10
]))
BATCH
,
tf
.
constant
([
0.1
]
*
10
,
tf
.
float32
,
shape
=
[
10
]))
z_cat
=
symbf
.
remove_shape
(
sample
,
0
,
name
=
'z_cat'
)
# still sample the latent code from a uniform distribution.
z_uni_a
=
symbf
.
remove_shape
(
...
...
tensorpack/tfutils/distributions.py
View file @
5d23f241
...
...
@@ -257,6 +257,10 @@ class ProductDistribution(Distribution):
def
param_dim
(
self
):
return
np
.
sum
([
d
.
param_dim
for
d
in
self
.
dists
])
@
property
def
sample_dim
(
self
):
return
np
.
sum
([
d
.
sample_dim
for
d
in
self
.
dists
])
def
_splitter
(
self
,
s
,
param
):
"""Input is split into a list of chunks according
to dist.param_dim along axis=1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment