MCPcopy Create free account

hub / github.com/Chrispresso/SnakeAI / functions

Functions89 in github.com/Chrispresso/SnakeAI

↓ 26 callersMethod_create_label_widget_in_grid
(self, string_label: str, font: QtGui.QFont, grid: QtWidgets.QGridLayou
snake_app.py:464
↓ 7 callersMethodcopy
(self)
misc.py:16
↓ 4 callersMethod_create_label_widget
(self, string_label: str, font: QtGui.QFont)
snake_app.py:457
↓ 4 callersFunctiongaussian_mutation
Perform a gaussian mutation for each gene in an individual with probability, prob_mutation. If mu and sigma are defined then the gaussian
genetic_algorithm/mutation.py:10
↓ 4 callersFunctionrandom_uniform_mutation
Randomly mutate each gene in an individual with probability, prob_mutation. If a gene is selected for mutation it will be assigned a value
genetic_algorithm/mutation.py:34
↓ 2 callersMethod__init__
(self, settings, show=True, fps=200)
snake_app.py:26
↓ 2 callersMethod_calc_distance
(self, x1, x2, y1, y2)
snake_app.py:606
↓ 2 callersMethodcalculate_fitness
(self)
snake.py:130
↓ 2 callersMethodfeed_forward
(self, X: np.ndarray)
neural_network.py:43
↓ 2 callersMethodgenerate_apple
(self)
snake.py:256
↓ 2 callersFunctionget_activation_by_name
(name: str)
neural_network.py:68
↓ 2 callersFunctionsingle_point_binary_crossover
(parent1: np.ndarray, parent2: np.ndarray, major='r')
genetic_algorithm/crossover.py:38
↓ 2 callersMethodupdate
(self)
snake.py:294
↓ 1 callersFunction_calc_stats
(data: List[Union[int, float]])
snake_app.py:614
↓ 1 callersMethod_crossover
(self, parent1_weights: np.ndarray, parent2_weights: np.ndarray, parent1_bias: np.ndarray,
snake_app.py:270
↓ 1 callersMethod_increment_generation
(self)
snake_app.py:265
↓ 1 callersMethod_is_apple_location
(self, position: Point)
snake.py:375
↓ 1 callersMethod_is_body_location
(self, position: Point)
snake.py:378
↓ 1 callersMethod_is_valid
Determine whether a given position is valid. Return True if the position is on the board and does not intersect the snake.
snake.py:381
↓ 1 callersMethod_mutation
(self, child1_weights: np.ndarray, child2_weights: np.ndarray, child1_bias: np.ndarray, chi
snake_app.py:292
↓ 1 callersMethod_vision_as_input_array
(self)
snake.py:227
↓ 1 callersMethod_within_wall
(self, position: Point)
snake.py:251
↓ 1 callersMethoddraw_apple
(self, painter: QtGui.QPainter)
snake_app.py:573
↓ 1 callersMethoddraw_border
(self, painter: QtGui.QPainter)
snake_app.py:498
↓ 1 callersMethoddraw_snake
(self, painter: QtGui.QPainter)
snake_app.py:512
↓ 1 callersFunctionelitism_selection
(population: Population, num_individuals: int)
genetic_algorithm/selection.py:8
↓ 1 callersMethodfrom_dict
(cls, d: Dict[str, int])
misc.py:28
↓ 1 callersMethodinit_snake
Initialize teh snake. starting_direction: ('u', 'd', 'l', 'r') direction that the snake should start facing. Whatever
snake.py:269
↓ 1 callersMethodinit_velocity
(self, starting_direction, initial_velocity: Optional[str] = None)
snake.py:402
↓ 1 callersMethodinit_window
(self)
snake_app.py:95
↓ 1 callersMethodlook
(self)
snake.py:163
↓ 1 callersMethodlook_in_direction
(self, slope: Slope)
snake.py:174
↓ 1 callersMethodmove
(self)
snake.py:304
↓ 1 callersMethodnext_generation
(self)
snake_app.py:175
↓ 1 callersFunctionroulette_wheel_selection
(population: Population, num_individuals: int)
genetic_algorithm/selection.py:12
↓ 1 callersMethodshow_network
(self, painter: QtGui.QPainter)
nn_viz.py:32
↓ 1 callersMethodto_dict
(self)
misc.py:21
↓ 1 callersMethodupdate
(self)
snake_app.py:117
Method__eq__
(self, other: Union['Point', Tuple[int, int]])
misc.py:31
Method__hash__
(self)
misc.py:54
Method__init__
(self, parent, snake: Snake)
nn_viz.py:10
Method__init__
(self, rise: int, run: int)
misc.py:6
Method__init__
(self, x: int, y: int)
misc.py:12
Method__init__
(self, dist_to_wall: Union[float, int], dist_to_apple: Union[float, int],
snake.py:18
Method__init__
(self, wall_location: Point, apple_location: Optional[Point] = None,
snake.py:29
Method__init__
(self, board_size: Tuple[int, int], chromosome: Optional[Dict[str, List[np.ndarray]]] = None
snake.py:40
Method__init__
(self, parent, settings)
snake_app.py:327
Method__init__
(self, parent, board_size=(50, 50), snake=None)
snake_app.py:475
Method__init__
(self, layer_nodes: List[int], hidden_activation: ActivationFunction,
neural_network.py:16
Method__init__
(self)
genetic_algorithm/individual.py:6
Method__init__
(self, individuals: List[Individual])
genetic_algorithm/population.py:7
Method__rsub__
(self, other: Tuple[int, int])
misc.py:49
Method__str__
(self)
misc.py:57
Method__sub__
(self, other: Union['Point', Tuple[int, int]])
misc.py:38
Method_draw_line_to_apple
(painter: QtGui.QPainter, start_x: int, start_y: int, drawable_vision: DrawableVision)
snake_app.py:523
Method_draw_line_to_self
(painter: QtGui.QPainter, start_x: int, start_y: int, drawable_vision: DrawableVision)
snake_app.py:530
Methodaverage_fitness
(self)
genetic_algorithm/population.py:27
Methodcalculate_fitness
(self)
genetic_algorithm/individual.py:10
Methodcalculate_fitness
(self)
genetic_algorithm/population.py:42
Functioncauchy_mutation
(individual: np.ndarray, scale: float)
genetic_algorithm/mutation.py:65
Methodchromosome
(self)
snake.py:137
Methodchromosome
(self)
genetic_algorithm/individual.py:33
Methoddecode_chromosome
(self)
snake.py:151
Methoddecode_chromosome
(self)
genetic_algorithm/individual.py:28
Methodencode_chromosome
(self)
snake.py:141
Methodencode_chromosome
(self)
genetic_algorithm/individual.py:24
Functionexponential_mutation
(chromosome: np.ndarray, xi: Union[float, np.ndarray], prob_mutation: float)
genetic_algorithm/mutation.py:68
Methodfitness
(self)
snake.py:127
Methodfitness
(self)
genetic_algorithm/individual.py:15
Methodfittest_individual
(self)
genetic_algorithm/population.py:35
Methodget_fitness_std
(self)
genetic_algorithm/population.py:46
MethodkeyPressEvent
(self, event: QtGui.QKeyEvent)
snake_app.py:595
Functionload_snake
(population_folder: str, individual_name: str, settings: Optional[Union[Dict[str, Any], str]] = None)
snake.py:453
Functionload_stats
(path_to_stats: str, normalize: Optional[bool] = True)
snake_app.py:661
Functionmmo_mutation
(chromosome: np.ndarray, prob_mutation: float)
genetic_algorithm/mutation.py:96
Methodnew_game
(self)
snake_app.py:487
Methodnum_genes
(self)
genetic_algorithm/population.py:19
Methodnum_individuals
(self)
genetic_algorithm/population.py:11
MethodpaintEvent
(self, event: QtGui.QPaintEvent)
nn_viz.py:21
MethodpaintEvent
(self, event: QtGui.QPaintEvent)
snake_app.py:585
Functionsave_snake
(population_folder: str, individual_name: str, snake: Snake, settings: Dict[str, Any])
snake.py:412
Functionsave_stats
(population: Population, path_to_dir: str, fname: str)
snake_app.py:623
Functionsimulated_binary_crossover
This crossover is specific to floating-point representation. Simulate behavior of one-point crossover for binary representations. Fo
genetic_algorithm/crossover.py:4
Methodsoftmax
(self, X: np.ndarray)
neural_network.py:65
Functiontournament_selection
(population: Population, num_individuals: int, tournament_size: int)
genetic_algorithm/selection.py:26
Functionuniform_binary_crossover
(parent1: np.ndarray, parent2: np.ndarray)
genetic_algorithm/crossover.py:28
Functionuniform_mutation_with_respect_to_best_individual
Ranomly mutate each gene in an individual with probability, prob_mutation. If a gene is selected for mutation it will nudged towards the ge
genetic_algorithm/mutation.py:54
Methodupdate
(self)
nn_viz.py:29
Methodupdate
(self)
snake_app.py:490