seldonian.utils.plot_utils.plot_gradient_descent¶
- plot_gradient_descent(solution, primary_objective_name, plot_running_avg=False, save=False, savename='test.png', show=True)¶
Make figure showing evolution of gradient descent. One row per constraint. The primary objective and lagrangian subplots are repeated in each row because they are not changing with the constraint
Plots: i) primary objective ii) lagrange multipliers for each constraint, lambda_i iii) each constraint function, g_i iv) Lagranian L = f + sum_i^n {lambda_i*g_i}
- Parameters:
solution (dict) – The solution dictionary returned by gradient descent
primary_objective_name (str) – The label you want displayed on the plot for the primary objective
plot_running_avg (bool) – Whether to plot running average of f and L
save (bool) – Whether to save the plot
savename (str) – The full path where you want to save the plot
show (bool) – Whether to show the plot with plt.show(). Only relevant when save=False