Skip to content

Instantly share code, notes, and snippets.

@jorgechato
Last active May 24, 2018 13:27
Show Gist options
  • Save jorgechato/fd07cae21d0528d0c3a8290b45229bcc to your computer and use it in GitHub Desktop.
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
# Keras implementation
from keras.models import Sequential
from keras.layers import Dense
model = Sequential()
model.add(Dense(32, input_shape=(16,)))
# 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