Skip to content

Instantly share code, notes, and snippets.

@Ruborcalor
Created May 3, 2020 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ruborcalor/626fe28243fd15ca1466e85d51300d04 to your computer and use it in GitHub Desktop.
Save Ruborcalor/626fe28243fd15ca1466e85d51300d04 to your computer and use it in GitHub Desktop.
Methylation: Neural Network Architecture
# Basic neural net with 4 dense layers
model = tf.keras.models.Sequential([
tf.keras.layers.Dense(1024, activation='relu', input_shape=(25,)),
tf.keras.layers.Dropout(0.2),
tf.keras.layers.Dense(1024, activation='relu'),
tf.keras.layers.Dropout(0.2),
tf.keras.layers.Dense(1024, activation='relu'),
tf.keras.layers.Dropout(0.2),
tf.keras.layers.Dense(1)
])
model.compile(loss= "mean_squared_error" , optimizer="adam", metrics=["mean_squared_error"])
model.summary()
model.fit(train_processed_np, train_processed_ages, epochs=50, validation_data=(test_processed_np, test_processed_ages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment