StepSizeSchedule

phasic.svgd.StepSizeSchedule()

Base class for step size schedules.

Subclasses should implement call(iteration, particles) returning a scalar step size.

Methods

Name Description
plot Plot the step size schedule over iterations.

plot

phasic.svgd.StepSizeSchedule.plot(
    nr_iter,
    figsize=None,
    title=None,
    ax=None,
    return_ax=False,
)

Plot the step size schedule over iterations.

Parameters

nr_iter : int

Number of iterations to plot

figsize : tuple = (4, 3)

Figure size (width, height) in inches

title : str = None

Plot title. If None, uses class name

ax : matplotlib.axes.Axes = None

Axes to plot on. If None, creates new figure

return_ax : bool = False

If True, return the axes object. If False, call plt.show() instead.

Returns

ax : matplotlib.axes.Axes or None

Axes object if return_ax=False, otherwise None

Examples

>>> schedule = ExpStepSize(first_step=0.1, last_step=0.01, tau=500.0)
>>> ax = schedule.plot(nr_iter=2000)
>>> plt.show()