after literally hours of pain, keras learns mnist
This commit is contained in:
16
nn.py
Normal file
16
nn.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
||||
|
||||
import tensorflow as tf
|
||||
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) # STFU!
|
||||
from mynet import load_mnist
|
||||
|
||||
|
||||
def create_mnist_network():
|
||||
model = tf.keras.models.Sequential([
|
||||
tf.keras.layers.Dense(30, input_shape=(784,), activation='relu'),
|
||||
tf.keras.layers.Dense(10, activation='softmax')
|
||||
])
|
||||
model.compile(loss='categorical_crossentropy', optimizer='sgd',
|
||||
metrics=['accuracy'])
|
||||
return model
|
||||
Reference in New Issue
Block a user