create_vbmc_animation

create_vbmc_animation#

pyvbmc.vbmc.create_vbmc_animation(vbmc: VBMC, path: str, as_frames: bool = False, suptitle='full', **kwargs: dict)[source]#

Create and save a gif animation of a VBMC optimization run.

Parameters:
vbmcVBMC

The optimized VBMC.

pathstr

The path where the gif should be saved to.

as_frames: bool, optional

If True, saves the animation as individual frames. The filename will be appended with the frame number. Default False.

suptitle: str, optional

What kind of supertitle to give the frame of each iteration. “full” (the default) gives the iteration and the actions of that iteration that the iteration log lists, such as “end warm-up”, or the iteration alone where there are none. “iteration” gives the iteration alone. “none” gives no supertitle. The last frame, which shows the final variational posterior, is titled with the number of iterations whatever the choice.

**kwargsdict, optional

Keyword arguments, passed to vp.plot().

Returns:
figmatplotlib.figure.Figure

The figure of the last frame, which shows the final variational posterior.

Raises:
ValueError

If the suptitle option is not one of the three supported values.