Getting Started
Examples
API Reference
porcupy.utils.helpers
initialize_population(pop_size, dim, lb, ub)
clip_to_bounds(positions, lb, ub)
porcupy.utils.plotting
plot_convergence(cost_history, title='Convergence Curve', save_path=None)
porcupy.utils.visualization
plot_2d_search_space(func, bounds, resolution=100, positions=None, best_pos=None, save_path=None)
animate_optimization_2d(position_history, func, bounds, best_pos_history=None, interval=100, contour_levels=20, save_path=None, dpi=100)
porcupy.utils.interactive_visualization
OptimizationDashboard
ParameterTuningDashboard
porcupy.functions
GPU_AVAILABLE
plot_convergence(cost_history[, title, save_path])
plot_convergence
Plot the convergence curve of the optimization process.
cost_history (ndarray) – Array of best fitness values over iterations.
title (str, optional) – Title of the plot (default: “Convergence Curve”).
save_path (str, optional) – Path to save the plot (e.g., “convergence.png”). If None, displays the plot.
None