PCAScanResult¶
- class PCAScanResult(x_offsets, y_offsets, values, parameter_sets, center, principal_component_x, principal_component_y, explained_variance_ratio, projected_samples, scan_component_ids, program_type)[source]¶
Bases:
objectAttributes Summary
Methods Summary
plot(*[, ax, show, levels, add_colorbar, ...])Plot the sampled PCA landscape and return
(fig, ax).plot_3d(*[, ax, show])Render the PCA landscape as a 3D surface and return
(fig, ax).Attributes Documentation
Methods Documentation
- plot(*, ax=None, show=False, levels=20, add_colorbar=True, show_samples=True, sample_kwargs=None, show_trajectory=False, trajectory_kwargs=None, show_gradients=False, gradient_kwargs=None, **contour_kwargs)[source]¶
Plot the sampled PCA landscape and return
(fig, ax).- Parameters:
ax – Optional matplotlib axes to draw into. When omitted, a new figure and axes are created.
show (
bool) – Whether to callmatplotlib.pyplot.show()after drawing.levels (
int) – Number of discrete color bands (BoundaryNorm) forpcolormesh.add_colorbar (
bool) – Whether to attach a colorbar to the figure.show_samples (
bool) – Whether to overlay the projected PCA samples on top of the heatmap.sample_kwargs (
dict|None) – Optional keyword arguments forwarded toax.scatterfor the PCA sample overlay.show_trajectory (
bool) – Whether to draw a connected line throughprojected_samplesin order. The samples must have been supplied in temporal order (e.g. fromparam_history()).trajectory_kwargs (
dict|None) – Optional keyword arguments forwarded toax.plotfor the trajectory line. Defaults to a thin white line with start/end markers.show_gradients (
bool) – Whether to overlay a quiver plot of the numerical gradient (computed vianumpy.gradient()on the grid).gradient_kwargs (
dict|None) – Optional keyword arguments forwarded toax.quiverfor the gradient overlay.**contour_kwargs – Additional keyword arguments forwarded to
ax.pcolormesh(corner_maskis ignored). PCA scans use a cell heatmap instead ofcontourfso noisy objectives still fill the axes.
- Returns:
(fig, ax)for the rendered plot.- Return type: