What?
This script aims to introduce basic AI into Skript using deep learning (deep neural networks). Training the network currently does not fully work (will fix hopefully soon). (I'll probably rewrite this later on as the code is pretty ugly and messy)
Requirements
None, this is all in vanilla Skript.
How does it work?
This script allows you to train and run a simple network based on your predefined settings.
How fast is it?
Pretty slow (running is pretty decent, training is slowwww).
Features
A lot of stuff is configurable such as:
What is planned on being added?
Fixing the network training is the main thing, but besides that...
Alright how do I use this then?
For a basic example, lets say you want to teach the network how to do XOR operations
So if we break that down, first we define the network size:
And if we were to draw out the example network, it would look something like this:
Next, we need to give it data to train on (and we do this for the combinations of XOR we want it to learn off of):
Once we give it stuff to train off of, we finally train the network:
Finally, we run the network which will return a list of the output neuron values:
This script is not intended to serve a practical use, it was written just for fun and to do stuff not previously thought of or done in Skript before.
This script aims to introduce basic AI into Skript using deep learning (deep neural networks). Training the network currently does not fully work (will fix hopefully soon). (I'll probably rewrite this later on as the code is pretty ugly and messy)
Requirements
None, this is all in vanilla Skript.
How does it work?
This script allows you to train and run a simple network based on your predefined settings.
How fast is it?
Pretty slow (running is pretty decent, training is slowwww).
Features
A lot of stuff is configurable such as:
- Input neuron count
- Hidden layer count
- Neuron count per layer
- Output neuron count
- How many epochs to train for
What is planned on being added?
Fixing the network training is the main thing, but besides that...
- More customization options (ie. custom activation functions, different network types)
- Support for text input/output by default
- Hopefully make it faster
Alright how do I use this then?
For a basic example, lets say you want to teach the network how to do XOR operations
Code:
command /xor <int> <int>:
trigger:
DSCreateNetwork(2, 2, 2, 1)
DSPumpTraining((0, 0), (0))
DSPumpTraining((1, 0), (1))
DSPumpTraining((0, 1), (1))
DSPumpTraining((1, 1), (0))
DSTrainNetwork(5, .1)
send "%DSRunNetwork((arg-1, arg-2))%"
So if we break that down, first we define the network size:
Code:
DSCreateNetwork(inputs, layers, neurons-per-layer, outputs)
And if we were to draw out the example network, it would look something like this:
Next, we need to give it data to train on (and we do this for the combinations of XOR we want it to learn off of):
Code:
DSPumpTraining(inputs, outputs)
Once we give it stuff to train off of, we finally train the network:
Code:
DSTrainNetwork(epochs, learning-rate)
Finally, we run the network which will return a list of the output neuron values:
Code:
DSRunNetwork(inputs)
This script is not intended to serve a practical use, it was written just for fun and to do stuff not previously thought of or done in Skript before.