Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
dec7c89f
Commit
dec7c89f
authored
Mar 24, 2017
by
Joshua Howard
Committed by
Neal Wu
Mar 27, 2017
Browse files
Variational Autoencoder generate() function fixed (z fed in rather than z_mean)
parent
ae50fa99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
autoencoder/autoencoder_models/VariationalAutoencoder.py
autoencoder/autoencoder_models/VariationalAutoencoder.py
+2
-3
No files found.
autoencoder/autoencoder_models/VariationalAutoencoder.py
View file @
dec7c89f
import
tensorflow
as
tf
import
tensorflow
as
tf
import
numpy
as
np
class
VariationalAutoencoder
(
object
):
class
VariationalAutoencoder
(
object
):
...
@@ -57,8 +56,8 @@ class VariationalAutoencoder(object):
...
@@ -57,8 +56,8 @@ class VariationalAutoencoder(object):
def
generate
(
self
,
hidden
=
None
):
def
generate
(
self
,
hidden
=
None
):
if
hidden
is
None
:
if
hidden
is
None
:
hidden
=
np
.
random
.
normal
(
size
=
self
.
weights
[
"b1"
])
hidden
=
self
.
sess
.
run
(
tf
.
random
_
normal
(
[
1
,
self
.
n_hidden
])
)
return
self
.
sess
.
run
(
self
.
reconstruction
,
feed_dict
=
{
self
.
z
_mean
:
hidden
})
return
self
.
sess
.
run
(
self
.
reconstruction
,
feed_dict
=
{
self
.
z
:
hidden
})
def
reconstruct
(
self
,
X
):
def
reconstruct
(
self
,
X
):
return
self
.
sess
.
run
(
self
.
reconstruction
,
feed_dict
=
{
self
.
x
:
X
})
return
self
.
sess
.
run
(
self
.
reconstruction
,
feed_dict
=
{
self
.
x
:
X
})
...
...
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