Skip to content

Commit

Permalink
Update vae_keras.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bojone authored Mar 18, 2018
1 parent a1318ae commit 625e5bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vae_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def sampling(args):
stddev=epsilon_std)
return z_mean + K.exp(z_log_var / 2) * epsilon

# 重参数层,相当于给输入加入早生
# 重参数层,相当于给输入加入噪声
z = Lambda(sampling, output_shape=(latent_dim,))([z_mean, z_log_var])

# 解码层,也就是生成器部分
Expand Down Expand Up @@ -84,7 +84,7 @@ def sampling(args):

x_test_encoded = encoder.predict(x_test, batch_size=batch_size)
plt.figure(figsize=(6, 6))
plt.scatter(x_test_encoded[:, 0], x_test_encoded[:, 1], c=y_test)
plt.scatter(x_test_encoded[:, 0], x_test_encoded[:, 1], c=y_test_)
plt.colorbar()
plt.show()

Expand Down

0 comments on commit 625e5bf

Please sign in to comment.