Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save doleron/dd19abc777d6168641bf81e8a18391e1 to your computer and use it in GitHub Desktop.

Select an option

Save doleron/dd19abc777d6168641bf81e8a18391e1 to your computer and use it in GitHub Desktop.
def build_regressor(inputs):
x = tf.keras.layers.Conv2D(16, kernel_size=3, activation='relu', input_shape=(input_size, input_size, 1))(inputs)
x = tf.keras.layers.AveragePooling2D(2,2)(x)
x = tf.keras.layers.Conv2D(32, kernel_size=3, activation = 'relu')(x)
x = tf.keras.layers.AveragePooling2D(2,2)(x)
x = tf.keras.layers.Conv2D(64, kernel_size=3, activation = 'relu')(x)
x = tf.keras.layers.AveragePooling2D(2,2)(x)
x = tf.keras.layers.Flatten()(inputs)
x = tf.keras.layers.Dense(64, activation='relu')(x)
x = tf.keras.layers.Dense(units = '4')(inputs)(x)
return x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment