A set of scripts for creating and learning your own artificial neural network. Creating your own artificial neural network (ANN) is not a big issue. But to teach the ANN to do certain tasks is a real challenge. In order to ease the task of creating and teaching the ANN, I wrote a set of scripts, that will do everything for you. The only thing that is needed from you is to “explain” the ANN properly, what information is needed to be learned. # A general scripts description. **Perceptron.cs** is a non MonoBehaviour script of an artificial neural network (ANN) the perceptron type. This script will automatically create the perceptron based on your parameters, fulfill a task (if the training takes place), save and load your ANN. **PerceptronInterface.cs** script can be used to facilitate the creation, visualization, saving and loading of ANNs during the learning process. This is the interface for the perceptron in the game mode. **PerceptronLernByBackPropagation.cs** is a non MonoBehaviour script for teaching the perceptron by the back propagation method. It is enough for you to specify a selection of tasks with responses or create a “teacher”, and ANN will start its training. And with the help of flexible settings, you can quickly and easily complete the training of the ANN. **PerceptronBackPropagationInterface.cs** is an interface script for teaching the perceptron by the back propagation method in the game mode. **PerceptronLernByRandomGeneration.cs** is a non MonoBehaviour script for teaching the perceptron by the randomly generating method of a certain amount of “clones” of the object, which you want to teach. All the generated “clones” receive the randomly modified perceptron. They receive it from the object of training of the first generation and from the best one of the previous generation on all of the subsequent generations. A large number of flexible learning settings allow one to get the self-taught perceptron. **PerceptronRandomGenerationInterface.cs** is an interface script for teaching the perceptron by the random generation method in a game mode. **ANN.cs** is a non MonoBehaviour script of an artificial neural network (ANN). This script will automatically create the ANN based on your parameters, fulfill a task (if the training takes place), save and load your ANN. **ANNNode.cs** is a non MonoBehaviour script that contains the core information of the ANN’s node. **ANNConnection.cs** is a non MonoBehaviour script that contains the core information of the ANN’s connection between nodes. **ANNInterface.cs** script can be used to facilitate the creation, visualization, saving and loading of ANNs during the learning process. This is the interface for the ANN in the game mode. **ANNLearnByNEAT.cs** is a non MonoBehaviour script for teaching the ANN by NEAT (NeuroEvolution of Augmenting Topologies). With the help of flexible settings, you can quickly and easily complete the training of the ANN. **ANNLearnByNEATInterface.cs** is an interface script for teaching the ANN by the NEAT in the game mode. **DrawANNWeight.cs** is a non MonoBehaviour script (static) for the perceptron’s weights visualization. It is used by the PerceptronInterface.cs script. **InterfaceGUI.cs** is a non MonoBehaviour script (static) for interfaces’ scripts. **Formulas.cs** is a non MonoBehaviour script (static) for fulfilling cyclic and alike tasks. **ActivationFunctions.cs** is a non MonoBehaviour script (static) that contains activation functions. # A detailed description of the main scripts. public class Perceptron – is a non MonoBehaviour script for an artificial neural network (ANN), type of the perceptron. | dd | dd | dd | |-|-|-| | dd | dd dd | | | | **The main variables of the Perceptron.cs script** | | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | public int AFT | The number of the activation function. | | public float AFS | A size of the activation function. | | public bool B | If it is “true”, then an additional displacement neuron is created in each layer, except for the original layer. This neuron is always equal to one. Its weight units affect all the neurons in the next layer, except for a bias neuron. | | public bool AFWM | If it is “true”, then all the neurons take the values from -1 to 1. This also applies to incoming and outgoing neurons. If it is “false” then all the neurons take values from 0 to 1. | | public float[] Input | The input layer of the ANN. The size of the array indicates the number of the input values, with a bias neuron (if B == true, the last neuron is always equal to 1). | | public int[] NIHL | The number of neurons in the hidden layers, with a bias neuron. The size of the array indicates the number of the hidden layers, with a bias neuron (if B == true, the last neuron of each layer is always equal to 1). | | public float[] Output | Output layer of the ANN. The size of the array indicates the number of the output values. It never contains a bias neuron. | | public float[][] Neuron | The value of neurons. The first part of the array corresponds to the layer of the perceptron. The second part of the array is the number of neurons in the layer. | | public float[][][] NeuronWeight | The value of the relations among the neurons. The first part of the array corresponds to the layer of the ANN. The second part of the array is the number of the neuron of the next layer. The third part of the array is the number of the current layer of the neuron. |