All Projects → alextousss → wargames

alextousss / wargames

Licence: other
two soldiers shooting at each other, controlled by a neural network with a genetic algorithm.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to wargames

NeuroEvolution-Flappy-Bird
A comparison between humans, neuroevolution and multilayer perceptrons playing Flapy Bird implemented in Python
Stars: ✭ 17 (-22.73%)
Mutual labels:  genetic-algorithm, artificial-neural-networks
GeneticAlgorithmForFeatureSelection
Search the best feature subset for you classification mode
Stars: ✭ 82 (+272.73%)
Mutual labels:  genetic-algorithm, genetic-programming
geneal
A genetic algorithm implementation in python
Stars: ✭ 47 (+113.64%)
Mutual labels:  genetic-algorithm, genetic-programming
arja
Multi-Objective GP for Automated Repair of Java
Stars: ✭ 31 (+40.91%)
Mutual labels:  genetic-algorithm, genetic-programming
Genann
simple neural network library in ANSI C
Stars: ✭ 1,088 (+4845.45%)
Mutual labels:  genetic-algorithm, artificial-neural-networks
tiny gp
Tiny Genetic Programming in Python
Stars: ✭ 58 (+163.64%)
Mutual labels:  genetic-algorithm, genetic-programming
binlex
A Binary Genetic Traits Lexer Framework
Stars: ✭ 303 (+1277.27%)
Mutual labels:  genetic-algorithm, genetic-programming
moses
MOSES Machine Learning: Meta-Optimizing Semantic Evolutionary Search. See also AS-MOSES https://github.com/opencog/asmoses but kept to guaranty backward compatibility.
Stars: ✭ 127 (+477.27%)
Mutual labels:  genetic-algorithm, genetic-programming
Gpdotnetv4
C# implementation of the various algorithms based on Genetic Algorithm, Genetic Programming and Artificial Neural Networks.
Stars: ✭ 19 (-13.64%)
Mutual labels:  genetic-algorithm, artificial-neural-networks
Hyperparameter Optimization Of Machine Learning Algorithms
Implementation of hyperparameter optimization/tuning methods for machine learning & deep learning models (easy&clear)
Stars: ✭ 516 (+2245.45%)
Mutual labels:  genetic-algorithm, artificial-neural-networks
Applying eanns
A 2D Unity simulation in which cars learn to navigate themselves through different courses. The cars are steered by a feedforward neural network. The weights of the network are trained using a modified genetic algorithm.
Stars: ✭ 1,093 (+4868.18%)
Mutual labels:  genetic-algorithm, artificial-neural-networks
Dino-AI
An AI to teach Google Chrome's dinosaur to jump obstacles.
Stars: ✭ 15 (-31.82%)
Mutual labels:  genetic-algorithm, artificial-neural-networks
OptimisationAlgorithms
Searching global optima with firefly algorithm and solving traveling salesmen problem with genetic algorithm
Stars: ✭ 20 (-9.09%)
Mutual labels:  genetic-algorithm
Deep-learning-model-deploy-with-django
Serving a keras model (neural networks) in a website with the python Django-REST framework.
Stars: ✭ 76 (+245.45%)
Mutual labels:  artificial-neural-networks
naturalselection
A general-purpose pythonic genetic algorithm.
Stars: ✭ 17 (-22.73%)
Mutual labels:  genetic-algorithm
Shapley regressions
Statistical inference on machine learning or general non-parametric models
Stars: ✭ 37 (+68.18%)
Mutual labels:  artificial-neural-networks
MV-Tractus
A simple tool to extract motion vectors from h264 encoded videos.
Stars: ✭ 83 (+277.27%)
Mutual labels:  artificial-neural-networks
geneticalgorithm2
Supported highly optimized and flexible genetic algorithm package for python
Stars: ✭ 36 (+63.64%)
Mutual labels:  genetic-algorithm
NeuralGenetic
Building and training artificial neural networks (regression or classification) using the genetic algorithm.
Stars: ✭ 187 (+750%)
Mutual labels:  genetic-algorithm
engineering design by artificial intelligence
Combining artificial intelligence and engineering design
Stars: ✭ 29 (+31.82%)
Mutual labels:  genetic-algorithm

wargames

Two soldiers shooting at each other, controlled by a neural network with a genetic algorithm. They both learn how to fight during the training process. The AIs are learning by playing a lot of games, but never see a human player telling it how to kill the other AI.

Inputs

The only informations an AI gets is the distance relative to its opponent, the corresponding angle and the number of updates since its last shot.

Neural Network

This data is processed by a single hidden layer neural network with 1 bias per layer. The adjustement of this bias value by the algorithm leads to anticipation of the future position of the ennemy AI (overfitting?).

Genetic Algorithm

At each generation, a tournament assigns the score of each AI. The chance of an AI to reproduce and give birth to a mutated AI is proportional to the square of its score.

Results

It works! In the first generations, the AIs barely move, and, generation after generation, they try differents moves: they approach or avoid the ennemy, try to scope ...

Screenshot :

screenshot

Dependencies

The game needs :

  • Python 3
  • Numpy
  • Pygame (Only for the -display part)

Usage:

To train a new set of AIs, type :

  • python3 main.py -simulate

To continue the training of other AIs, type :

  • python3 main.py -simulate

The default output of the save command is located at saves/save_{save_number}/{generation} \

To visualize a tournament with all the AIs:

  • python3 main.py -display
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].