3

I was implementing my own progress monitor by appending loss of each step into a List and Dynamically ListPlot it. However, this method will cause memory insufficiency and significant laggy of frontend.

I would like to know how the very new Neural Network package monitors its training progress. Training Progress

Louis Yu
  • 857
  • 4
  • 13
  • 1
    Repeated Append is a common performance pitfall because Mathematica's lists are not linked lists but rather arrays. If you use a linked list then it will be a lot faster. I don't know anything about the Neural Networks package but I do wonder how it determines that training will require 5346 rounds in this case. From the plot it looks like it is already close to converging having done only a tenth of this many rounds. – Oleksandr R. Mar 26 '17 at 14:29
  • @OleksandrR. Thanks! If a max round/time number is not specified, it will automatically calculate one. But the documentation doesn't mention about how. – Louis Yu Mar 26 '17 at 14:37
  • regarding the problem of plotting dynamically without the slow-down given by append, see this related post: http://mathematica.stackexchange.com/a/84348/27539 – glS Mar 28 '17 at 12:59

1 Answers1

5

It uses bag = Internal`Bag[] to create an empty bag, Internal`StuffBag[bag, val] to add values to the bag, and Internal`BagPart[bag, All] to convert the contents of the bag to a packed array.

Taliesin Beynon
  • 10,639
  • 44
  • 51