Neural Networks in AI Toy Box


Neural Networks in AI Toy Box

Overview - 

The learning system utilized in AI Toy Box is a form of neuroevolution. The network design for each game is manually set up and is fully connected. There is no augmentation of the topology of the network. The only evolving parts of the network and the weights and biases. However, this was perfectly sufficient for the challenges in AI Toy Box. The player sets the structure of the network’s hidden nodes. The inputs and outputs are predefined for each game. Next the player selects the population size (number of AI agents). Then, the AI then begin to train on the challenge while the player can adjust settings such as, game time, agent lifetime, mutation chance and mutation strength. 

Definitions - 

Activation Function - A math function that generally takes in an input from -1 to 1 and returns an output of -1 to 1. Common activation functions include: ReLu, tanh, Sigmoid, Binary Step, and Linear. AI Toy Box networks all use tanh activations.

Weight - A value multiplied with an input to produce an output. (Before a value can travel from one node to another, a weight must be applied to it according to the connection the value will use to reach the next node).

Bias - A value added to an input after the input has gone through the activation function/

Neural Networks in AI Toy Box - 

AI Toy Box uses feed-forward neural networks to determine AI action. A neural network is a computational structure consisting of nodes and connections. Each node has an activation and a bias, and each connection has a weight. Values are assigned to the input layer and the network processes these inputs and assigns values to the output nodes. The processing goes as follows:

  1. Collect inputs
  2. Assign inputs to the first layer of the neural network
  3. Foreach layer (excluding the input layer) (L)
    1. Foreach neuron in the layer (N)
      1. Set a value (V)
      2. Foreach neuron in the previous layer (P)
        1. V += (Weight connection N to P) * (value of P)
      3. Value of N = activation_function(V + Bias of N)
  4. Return an array containing the values of the output neurons to use for values in functions controlling the AI

Get AI Toy Box

Leave a comment

Log in with itch.io to leave a comment.