post-merge cleanup
This commit is contained in:
parent
5ab0f21a84
commit
985c7c0d77
Binary file not shown.
@ -18,7 +18,7 @@ class DecisionTree:
|
|||||||
self.vec = None
|
self.vec = None
|
||||||
|
|
||||||
def build(self, training_file: str, depth: int):
|
def build(self, training_file: str, depth: int):
|
||||||
path = os.path.join("../..", "..", "resources", "data", training_file)
|
path = os.path.join("../..", "..", "resources", "data", "decision_tree", training_file)
|
||||||
|
|
||||||
samples = list()
|
samples = list()
|
||||||
results = list()
|
results = list()
|
||||||
|
Binary file not shown.
@ -128,8 +128,8 @@ if __name__ == "__main__":
|
|||||||
# neural_network.save()
|
# neural_network.save()
|
||||||
|
|
||||||
# Loading a model from file:
|
# Loading a model from file:
|
||||||
neural_network = NeuralNetwork(NNType.SERIES, r"series/saved_model.h5", r"series/saved_model_classes.joblib")
|
neural_network = NeuralNetwork(NNType.SPECIFICITY, r"specificity/saved_model.h5", r"specificity/saved_model_classes.joblib")
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
image = r"../../../resources/data/neural_network/series/disarm/W/5.jpg"
|
image = r"../../../resources/data/neural_network/specificity/disarm/tanks/1-35-British-Tank-FV-214-Conqueror-MK-II-Amusing-Hobby-35A027-AH-35A027_b_0.JPG"
|
||||||
neural_network.get_answer(image)
|
neural_network.get_answer(image)
|
||||||
|
@ -3,7 +3,7 @@ from assets import asset_constants as asset
|
|||||||
import json
|
import json
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from pygame import transform
|
from pygame import transform
|
||||||
from algorithms.learn.decision_tree import DecisionTree
|
from algorithms.learn.decision_tree.decision_tree import DecisionTree
|
||||||
|
|
||||||
|
|
||||||
# Class of our agent, initialization of it
|
# Class of our agent, initialization of it
|
||||||
@ -21,8 +21,8 @@ class Agent:
|
|||||||
self.row, self.column = int(self.row), int(self.column)
|
self.row, self.column = int(self.row), int(self.column)
|
||||||
self.position = [self.row, self.column]
|
self.position = [self.row, self.column]
|
||||||
self.on_screen_coordinates = const.get_tile_coordinates(tuple(self.position))
|
self.on_screen_coordinates = const.get_tile_coordinates(tuple(self.position))
|
||||||
self.decision_tree = DecisionTree(const.ROOT_DIR + "/algorithms/learn/decision_tree.joblib",
|
self.decision_tree = DecisionTree(const.ROOT_DIR + "/algorithms/learn/decision_tree/decision_tree.joblib",
|
||||||
const.ROOT_DIR + "/algorithms/learn/dict_vectorizer.joblib")
|
const.ROOT_DIR + "/algorithms/learn/decision_tree/dict_vectorizer.joblib")
|
||||||
self.direction = const.Direction(data["agents_initial_state"]["direction"])
|
self.direction = const.Direction(data["agents_initial_state"]["direction"])
|
||||||
self.rotation_angle = -const.Direction(self.direction).value * 90
|
self.rotation_angle = -const.Direction(self.direction).value * 90
|
||||||
self.going_forward = False
|
self.going_forward = False
|
||||||
|
Loading…
Reference in New Issue
Block a user