# Pluto widget for viewing Flux / FluxTraining progress?

**URL:** <https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393>\
**Category:** Tooling\
**Created:** [May 3, 2022, 12:49am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393 "2022-05-03T00:49:21Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxeonyx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxeonyx/32/35905_2.png) [@maxeonyx](https://discourse.julialang.org/u/maxeonyx)\
**Post date:** [May 3, 2022, 12:49am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/1 "2022-05-03T00:49:21Z")

</div>

Does anyone know if there’s a rich formatter for showing the progress of training in Pluto when training models using Flux or FluxTraining?

I’d quite like to use this if it exists. The current UX for training inside a notebook is pretty bad.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 3, 2022, 5:20am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/2 "2022-05-03T05:20:39Z")

</div>

Is this what you need? [[ANN] Pluto 0.17.6](https://discourse.julialang.org/t/ann-pluto-0-17-6/75011)

---

<div class="post-metadata">

**Author:** ![maxeonyx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxeonyx/32/35905_2.png) [@maxeonyx](https://discourse.julialang.org/u/maxeonyx)\
**Post date:** [May 3, 2022, 5:31am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/3 "2022-05-03T05:31:01Z")

</div>

I found the progress bar support since asking the question, but it’s not really what I am looking for. I’m looking for something that can display live metrics inside Pluto. For example, a progress bar, live loss plot, example data at the end of each epoch, etc.

I assume most people are simply using Tensorboard via Flux’s Tensorboard logger. That’s OK, but for experimenting with visualizations of my model and data I’d love to have the visualizations within Pluto.

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [May 3, 2022, 7:20am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/4 "2022-05-03T07:20:17Z")

</div>

Maybe PlutoUI `with_terminal` can be of use?  
[https://docs.juliahub.com/PlutoUI/abXFp/0.7.38/#Terminal-addiction-1](https://docs.juliahub.com/PlutoUI/abXFp/0.7.38/#Terminal-addiction-1)

---

<div class="post-metadata">

**Author:** ![skleinbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skleinbo/32/36080_2.png) [@skleinbo](https://discourse.julialang.org/u/skleinbo)\
**Post date:** [May 3, 2022, 8:56am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/5 "2022-05-03T08:56:54Z")

</div>

`with_terminal` also only displays the printout after the cell has returned.

A quick look (not that I have any substantial understanding of the code base) at the changes introduced to facilitate live display of logging messages suggests that the developers had to jump through a few hoops to make that happen. This suggests to me, that updating the output of a cell while it is running is far from trivial. But I may be mistaken here.  
It certainly would be a very nice feature to have.

@fonsp

---

<div class="post-metadata">

**Author:** ![disberd](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@disberd](https://discourse.julialang.org/u/disberd)\
**Post date:** [May 4, 2022, 1:48pm UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/6 "2022-05-04T13:48:48Z")

</div>

You can actually do it already using the logging functionality and the `@info` macro for example. You can also put whatever _showable_ julia object inside logs which is pretty neat specifically for adding plots to them:  
 ![c5804768-264a-48e9-9a5b-9937f39da06c](https://global.discourse-cdn.com/julialang/original/3X/9/c/9c481f7f2d435d5e69a3fc292aef33188d6fdfaf.gif)

Only problem is that each log is separate and you can’t just update the previous log, so things can become quite cluttered if you are planning on printing a lot of updates within the same celle execution.

---

<div class="post-metadata">

**Author:** ![maxeonyx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxeonyx/32/35905_2.png) [@maxeonyx](https://discourse.julialang.org/u/maxeonyx)\
**Post date:** [May 4, 2022, 9:01pm UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/7 "2022-05-04T21:01:29Z")

</div>

Thanks! That’s _almost_ it. Do you think that’s the limit for what Pluto can do right now? Are there custom components which handle rich log messages?

---

<div class="post-metadata">

**Author:** ![disberd](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@disberd](https://discourse.julialang.org/u/disberd)\
**Post date:** [May 5, 2022, 5:53am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/8 "2022-05-05T05:53:26Z")

</div>

what do you mean by _rich_? You can display there whatever you can display in Pluto, which in my opinion makes it very rich

---

<div class="post-metadata">

**Author:** ![CarloLucibello](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carlolucibello/32/3278_2.png) [@CarloLucibello](https://discourse.julialang.org/u/CarloLucibello)\
**Post date:** [May 5, 2022, 6:21am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/9 "2022-05-05T06:21:26Z")

</div>

I find the printing behavior in Pluto dissatisfying as well. I just want code like

```julia
for epoch in epochs 
   ...
   @info (; epoch, loss, accuracy)
end

```

to be displayed the same way as in the repl and in jupyter notebook, vertically, not in boxes overlapping with each other.

---

<div class="post-metadata">

**Author:** ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)\
**Post date:** [May 5, 2022, 6:46am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/10 "2022-05-05T06:46:00Z")

</div>

`with_terminal()` is not required anymore in the most recent Pluto version for showing stdin/stderr in the notebook

[https://github.com/fonsp/Pluto.jl/pull/1957](https://github.com/fonsp/Pluto.jl/pull/1957)

---

<div class="post-metadata">

**Author:** ![maxeonyx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxeonyx/32/35905_2.png) [@maxeonyx](https://discourse.julialang.org/u/maxeonyx)\
**Post date:** [May 6, 2022, 3:38am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/11 "2022-05-06T03:38:15Z")

</div>

Hey,

What I mean by rich was exactly that yes, and I agree. I didn’t realize you could have anything in the log messages.

However I also had something else in mind, which was a JavaScript components to collect the log messages as they arrive and display them in a custom way. For example, a component that shows a progress bar, a frequently updating table of the latest values for a selection of statistics, as well as a scrolling vertical list of rich log messages. The progress bar and statistics should remain visible when scrolling.

I have had a look at the code now and I can see that there’s no blessed way to implement this right at the moment. I’m not necessarily suggesting you implement it, but what I’m looking for is a way to create a Julia package that integrates with Pluto including the ability to include a custom log message handler frontend component.

I originally assumed this already existed and was looking for whether someone already created a component for Flux.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 6, 2022, 5:46am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/12 "2022-05-06T05:46:21Z")

</div>

In terms of custom printing, maybe [https://github.com/FedeClaudi/Term.jl](https://github.com/FedeClaudi/Term.jl) is your best bet. No idea how well it works in Pluto though

---

<div class="post-metadata">

**Author:** ![jondea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jondea/32/39086_2.png) [@jondea](https://discourse.julialang.org/u/jondea)\
**Post date:** [May 8, 2022, 1:43am UTC](https://discourse.julialang.org/t/pluto-widget-for-viewing-flux-fluxtraining-progress/80393/13 "2022-05-08T01:43:25Z")

</div>

Could the [PlutoLinks](https://github.com/JuliaPluto/PlutoLinks.jl) package help? You could run your model using `@use_task` and generate your dashboard using cells which depend on the output data. `@use_file` might also work, and you could build in some kind of caching so that training progress is saved.
