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

  • 1
    $\begingroup$ 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. $\endgroup$ Commented Mar 26, 2017 at 14:29
  • $\begingroup$ @OleksandrR. Thanks! If a max round/time number is not specified, it will automatically calculate one. But the documentation doesn't mention about how. $\endgroup$
    – Louis Yu
    Commented Mar 26, 2017 at 14:37
  • $\begingroup$ regarding the problem of plotting dynamically without the slow-down given by append, see this related post: mathematica.stackexchange.com/a/84348/27539 $\endgroup$
    – glS
    Commented Mar 28, 2017 at 12:59

1 Answer 1


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.