neuro-lab3/nn2.py

23 lines
452 B
Python

import tensorflow as tf
import tensorflow.keras.layers as l
from sys import argv
import f
m = tf.keras.models.Sequential([
l.Input(shape = (784,)),
l.Dense(64, activation = "relu"),
l.Dense(20, activation = "relu"),
l.Dense(10, activation = "softmax")
])
model_label = "2"
#f.train(m, model_label)
f.model_quality(m, model_label)
if len(argv) == 2:
f.classify(m, model_label, argv[1])
else:
f.classify_live(m, model_label)