neuro-lab3/nn3.py

24 lines
496 B
Python
Raw Normal View History

2025-10-11 21:57:26 +03:00
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(4096, activation = "relu"),
l.Dense(4096, activation = "relu"),
l.Dense(4096, activation = "relu"),
l.Dense(10, activation = "softmax")
])
model_label = "3"
#f.train(m, model_label)
f.model_quality(m, model_label)
2025-10-11 21:57:26 +03:00
if len(argv) == 2:
f.classify(m, model_label, argv[1])
2025-10-11 21:57:26 +03:00
else:
f.classify_live(m, model_label)