Skip to content

Instantly share code, notes, and snippets.

@ispamm
Last active April 16, 2018 18:43
Show Gist options
  • Save ispamm/f8669ef6052f1f8fa68684f178de3320 to your computer and use it in GitHub Desktop.
Save ispamm/f8669ef6052f1f8fa68684f178de3320 to your computer and use it in GitHub Desktop.
class SingleHiddenLayerNetwork(tf.keras.Model):
def __init__(self):
super(SingleHiddenLayerNetwork, self).__init__()
self.hidden_layer = tf.layers.Dense(10, activation=tf.nn.tanh, use_bias=True)
self.output_layer = tf.layers.Dense(3, use_bias=True, activation=None)
def call(self, x):
# Forward-pass logic
return self.output_layer(self.hidden_layer(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment