Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created April 19, 2019 12:42
Show Gist options
  • Save NMZivkovic/bef49a0f557e38eec31cb68899a8ffdc to your computer and use it in GitHub Desktop.
Save NMZivkovic/bef49a0f557e38eec31cb68899a8ffdc to your computer and use it in GitHub Desktop.
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import Dense
class SimpleNeuralNetwork(Model):
def __init__(self):
super(SimpleNeuralNetwork, self).__init__()
self.layer1 = Dense(2, activation='relu')
self.layer2 = Dense(3, activation='relu')
self.outputLayer = Dense(1, activation='softmax')
def call(self, x):
x = self.layer1(x)
x = self.layer2(x)
return self.outputLayer(x)
model = SimpleNeuralNetwork()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment