Here is another one. This one is bigger and changes the API of stylize.stylize in order to optionally store and/or plot loss values for convergence monitoring:
Add --progress-write and --progress-plot to save and/or plot loss values at every print_iterations step.
For that, we need to modify the behavior of the stylize() function. This function now yields tuples (iteration, image, loss_vals) at every iteration, not every checkpoint_iterations and at the last step as before. Also, stylize() does not set iteration to None at the last step. image and loss_vals are None by default. Each checkpoint_iterations, image is not None. Each print_iterations, loss_vals is not None, i.e we can save images and store the loss at different frequencies.
loss_vals is a dict with loss values for the current iteration, e.g. {'content': 1.23, 'style': 4.56, 'tv': 7.89, 'total': 13.68}.
neural_style.py was adapted accordingly. The default CLI behavior of neural_style.py is unchanged.
Here is another one. This one is bigger and changes the API of
stylize.stylize
in order to optionally store and/or plot loss values for convergence monitoring:Add
--progress-write
and--progress-plot
to save and/or plot loss values at everyprint_iterations
step.For that, we need to modify the behavior of the
stylize()
function. This function now yields tuples(iteration, image, loss_vals)
at every iteration, not everycheckpoint_iterations
and at the last step as before. Also,stylize()
does not setiteration
to None at the last step.image
andloss_vals
are None by default. Eachcheckpoint_iterations
,image
is not None. Eachprint_iterations
,loss_vals
is not None, i.e we can save images and store the loss at different frequencies.loss_vals
is a dict with loss values for the current iteration, e.g.{'content': 1.23, 'style': 4.56, 'tv': 7.89, 'total': 13.68}
.neural_style.py was adapted accordingly. The default CLI behavior of neural_style.py is unchanged.