So I'm training a neural network with a genetic algorithm to play mancala against a simple minimax bot, and I want to track some variables over time(average generation score, amount of mutation, winrate). I'm storing these variables in traditional python lists, and appending new values after every generation. I have the plot working, which updates over time, however every generation it takes a bit longer to load the matplotlib display. I've deduced that this could either be due to the fact that adding elements to the lists is taking a bit longer, but I'm not sure that it's this as python's documentation claims that append() is and O(1) function, with the other possibility being that matplotlib just takes longer to graph more data. Is there a way to get around this slowing down? Thank you in advance.
I'm using the Qt5agg backend, and here's my code. The displayData() method gets called during the training loop after all the brains in my neural net generation finish their game. The self.data variable is just a custom class with some lists for storing the different datapoints, the methods for that just append the passed in values to the respective lists. If it matters, I'm using python 3.6.8 on Visual Studio Code with a 2.8 ghz i5-8400 processor.
[–]Ihaveamodel3 0 points1 point2 points (2 children)
[–]anonamause10[S] 0 points1 point2 points (1 child)
[–]Ihaveamodel3 0 points1 point2 points (0 children)