mirror of
https://github.com/3x4byte/StreetsignRecognition.git
synced 2025-12-21 01:15:52 +00:00
fix: nn learn now takes training data in its order (this prevents that some vectors are never used)
This commit is contained in:
@@ -38,7 +38,7 @@ class NeuralNetwork:
|
||||
correct_amount = 0
|
||||
false_amount = 0
|
||||
for i in range(len(training_set)):
|
||||
fv_to_train = random.choice(training_set)
|
||||
fv_to_train = training_set # random.choice(training_set)
|
||||
classified_concept, correct = self.classify(fv_to_train)
|
||||
|
||||
if not correct:
|
||||
|
||||
@@ -68,9 +68,9 @@ def neural_network(training = os.path.abspath(os.path.join(__file__, "..", "trai
|
||||
next(reader)
|
||||
i = 0
|
||||
for row in reader:
|
||||
i += 1
|
||||
if i > num_training_vectors:
|
||||
break
|
||||
i += 1
|
||||
|
||||
float_list = ast.literal_eval(row[3])
|
||||
|
||||
@@ -100,4 +100,6 @@ def neural_network(training = os.path.abspath(os.path.join(__file__, "..", "trai
|
||||
return [cnt_correct, cnt_data - cnt_correct, cnt_data] # richtig, falsch, amount of testing data
|
||||
|
||||
if __name__ == "__main__":
|
||||
neural_network()
|
||||
for i in range(100, 10000, 100):
|
||||
print(f"{i} training vectors: ", end="")
|
||||
neural_network()
|
||||
Reference in New Issue
Block a user