Source: vis/callbacks.py#L0
OptimizerCallback
Abstract class for defining callbacks for use with Optimizer.minimize.
OptimizerCallback.callback
callback(self, i, named_losses, overall_loss, grads, wrt_value)
This function will be called within optimizer.minimize.
Args:
- i: The optimizer iteration.
- named_losses: List of
(loss_name, loss_value)
tuples. - overall_loss: Overall weighted loss.
- grads: The gradient of input image with respect to
wrt_value
. - wrt_value: The current
wrt_value
.
OptimizerCallback.on_end
on_end(self)
Called at the end of optimization process. This function is typically used to cleanup / close any opened resources at the end of optimization.
Callback to print values during optimization.
Print.callback
callback(self, i, named_losses, overall_loss, grads, wrt_value)
Print.on_end
on_end(self)
Called at the end of optimization process. This function is typically used to cleanup / close any opened resources at the end of optimization.
GifGenerator
Callback to construct gif of optimized image.
GifGenerator.__init__
__init__(self, path)
Args:
- path: The file path to save gif.
GifGenerator.callback
callback(self, i, named_losses, overall_loss, grads, wrt_value)
GifGenerator.on_end
on_end(self)