Last active
May 24, 2018 13:27
-
-
Save jorgechato/fd07cae21d0528d0c3a8290b45229bcc to your computer and use it in GitHub Desktop.
This is an easy example to type a dense layer in keras vs tensorflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Keras implementation | |
from keras.models import Sequential | |
from keras.layers import Dense | |
model = Sequential() | |
model.add(Dense(32, input_shape=(16,))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tensorflow implementation | |
import tensorflow as tf | |
x1 = tf.layers.dense(z, 4*4*512) | |
inputs_z = tf.placeholder( | |
tf.float32, | |
(None, z_dim), | |
name=‘input_z’ | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment