Last active
May 31, 2020 17:25
-
-
Save rayheberer/1f0bf4d1d3f0feee79b6f96480d9cba4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import tensorflow as tf | |
def build_nn(input_shape, hidden_units=(20, 20), output_size=1, output_activation=None): | |
inputs = tf.keras.Input(shape=input_shape) | |
hidden = inputs | |
for layer_units in hidden_units: | |
hidden = tf.keras.layers.Dense(layer_units, activation=tf.nn.relu)(hidden) | |
outputs = tf.keras.layers.Dense(output_size, activation=output_activation)(hidden) | |
model = tf.keras.Model(inputs=inputs, outputs=outputs) | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment