We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am currently working on training an AI to play a simple 1v1 game. It has a neural networks with 2 hidden layers, 21 neurons each, so the sum of every individual weight amounts to nearly half a thousand. I am using a genetic algorithm where 100 AI’s are paired up and only the victorious ones get to reproduce. My question is: once an adequately intelligent AI is born, I want to be able to easily replicate its weights in other sketches in order to have it play against players. Thing is, since its weights are in the hundreds, it would be insane to for example println the weights and have to copy them one by one. Is there a better way?
Answers
https://www.tutorialspoint.com/java/java_serialization.htm
the above isn't human readable so many people prefer to use other methods. the xml is human readable but verbose. json is more concise (but lacks the ability to add comments).
well, you can just for loop over the neurons and store them in an array and then use saveStrings and in the other sketch loadStrings
or loadTable
https://www.processing.org/reference/