Created
April 20, 2019 08:03
-
-
Save NMZivkovic/d3c418118baf430a6e674c700e305b41 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
class IrisClassifier(Model): | |
def __init__(self): | |
super(IrisClassifier, self).__init__() | |
self.layer1 = Dense(10, activation='relu') | |
self.layer2 = Dense(10, activation='relu') | |
self.outputLayer = Dense(3, activation='softmax') | |
def call(self, x): | |
x = self.layer1(x) | |
x = self.layer2(x) | |
return self.outputLayer(x) | |
model = IrisClassifier() | |
model.compile(optimizer=tf.keras.optimizers.Adam(), | |
loss='categorical_crossentropy', | |
metrics=['accuracy']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment