Skip to content

Instantly share code, notes, and snippets.

@StrikingLoo
Created June 12, 2019 16:53
Show Gist options
  • Select an option

  • Save StrikingLoo/dc00890ccb59aae40dc1b5fc8b8ca90d to your computer and use it in GitHub Desktop.

Select an option

Save StrikingLoo/dc00890ccb59aae40dc1b5fc8b8ca90d to your computer and use it in GitHub Desktop.
from tensorflow import keras
from tensorflow.keras import layers
total_pixels = img_size[0] *img_size[1] * 3
fc_size = 512
inputs = keras.Input(shape=(img_size[1], img_size[0],3), name='ani_image')
x = layers.Flatten(name = 'flattened_img')(inputs) #turn image to vector.
x = layers.Dense(fc_size, activation='relu', name='first_layer')(x)
outputs = layers.Dense(1, activation='sigmoid', name='class')(x)
model = keras.Model(inputs=inputs, outputs=outputs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment