Pluto --- Function barrier

Dear all,

I am sure that this was here solved / asked before, but i have not found the answer.
I am playing with the idea of implementing a visual frontend for Mill / JsonGrinder, which will allow you to upload the training data, tweak a model, and then let you start training. I would like to delay a training, such that it will start after all the stuff like models is finished. Thus, I need something like a barrier. I wanted to implement it using a “Button”, where I would have a start button and the training will start if I change the button. But this does not work, because I cannot assign the value to the variable bind to the button.

Something like:

Cell defining button

md"""
$(@bind go Button("Train!"))
"""

Cell performing training

if go == "Train!"
	Flux.Optimise.train!((x,y) -> loss(model, x, y), ps, repeatedly(minibatch, iterations), opt)
        go = "finished"
end

Does anyone has an idea, how can I achieve this?

Thanks for an answer in advance.

I prefer to use CheckBox for execution barriers - it’s a better fit for Pluto’s reactivity model.

md"""
Train! $(@bind cb CheckBox())
"""
if cb
	"go!"
end
3 Likes

The functionality to delay execution of specific cells (and their dependencies) will be available in Pluto itself soon - you can try it out here (GUI not final, but should be fully operational):

For usage, you could take a look at my PlutoCon talk:

2 Likes

I was watching your talk and I was thinking about the solution. The checkbox is a neat idea. Thanks a lot.

1 Like