more data
This commit is contained in:
@@ -3,7 +3,7 @@ from network import Network
|
||||
from trainer import Trainer
|
||||
|
||||
network = Network()
|
||||
network.build_layers(3, 36, 3, 12)
|
||||
network.build_layers(3, 37, 4, 12)
|
||||
network.connect_layers()
|
||||
|
||||
trainer = Trainer(network, "./data.train")
|
||||
@@ -13,16 +13,23 @@ print("Erkenne die Art eines zeichens (Konsontant, Vokal oder Zahl).")
|
||||
while True:
|
||||
inpt = input("Dein Zeichen: ").lower()
|
||||
|
||||
vec = [0 for _ in range(0, 36)]
|
||||
vec = [0 for _ in range(0, 37)]
|
||||
refrence = string.ascii_lowercase + string.digits
|
||||
vec[refrence.index(inpt)] = 1
|
||||
try:
|
||||
index = refrence.index(inpt)
|
||||
except Exception:
|
||||
index = 36
|
||||
|
||||
vec[index] = 1
|
||||
|
||||
output = network.fire(vec)
|
||||
|
||||
print(f"Konsontant: {round(output[0], 2)} | Vokal: {round(output[1], 2)} | Zahl: {round(output[2], 2)}")
|
||||
print(f"Konsontant: {round(output[0], 2)} | Vokal: {round(output[1], 2)} | Zahl: {round(output[2], 2)} | Unbekannt: {round(output[3], 2)}")
|
||||
if max(output) == output[0]:
|
||||
print("AI Denkt: Konsontant")
|
||||
elif max(output) == output[1]:
|
||||
print("AI Denkt: Vokal")
|
||||
elif max(output) == output[2]:
|
||||
print("AI Denkt: Zahl")
|
||||
else:
|
||||
print("AI Denkt: Zahl")
|
||||
print("AI Denkt: Unbekannt")
|
||||
Reference in New Issue
Block a user