// Save the variable `a` and change its value right after:
// %%
manager.save()
_ = a.assign(0.33)
// %% [markdown]
// Now we can restore the old variable value:
After Change
print_task = ExecuteCallback(callback=print_cb)
// We group these tasks and specify a period of `100` steps for them
fast_tasks = MonitorTaskGroup([model_task, elbo_task, print_task], period=100)
// We also want to see the model"s fit during the optimisation
image_task = ImageToTensorBoard(output_logdir, plot_model, "samples_image")
// We typically don"t want to plot too frequently during optimisation,
// which is why we specify a larger period for this task.
slow_taks = MonitorTaskGroup(image_task, period=500)
monitor = Monitor(fast_tasks, slow_taks)
def monitored_training_loop(epochs: int):
tf_optimization_step = tf.function(optimization_step)