ograph.applications package
Submodules
ograph.applications.swarm module
- ograph.applications.swarm.plot_positions(data: ndarray[tuple[Any, Any], dtype[float64]] | Sequence[Sequence[float]] | ndarray[tuple[Any, Any, Any], dtype[float64]] | Sequence[Sequence[Sequence[float]]], objective: Callable[[float, float], float] | None = None, *, override_region: ndarray[tuple[Any, Any], dtype[float64]] | Sequence[Sequence[float]] | None = None, override_margin: float | None = None)[source]
Plot a sequence of collections of points as they change over time.
- Parameters:
data –
Either a 2-D tensor or a 3-D tensor. * If
datais 2-D: data[t] is a single point. Plotits change over time.
- If
datais 3-D: data[t] is a collection oof points. Plot the change of these points over time.
- If
objective – An objective function to be plotted as background.
override_region – Only plot points that fall in this region.
override_margin – A small margin to add to override_region. Might make the plot prettier.
- ograph.applications.swarm.plot_bests(data: ~numpy.ndarray[tuple[~typing.Any, ~typing.Any], ~numpy.dtype[~numpy.float64]] | ~typing.Sequence[~typing.Sequence[float]], best_selector: ~typing.Callable[[~numpy.ndarray[tuple[~typing.Any, ~typing.Any], ~numpy.dtype[~numpy.float64]] | ~typing.Sequence[~typing.Sequence[float]]], ~numpy.float64] = <function max>, best_label: str = 'Best value', all_label: str = 'All values') None[source]
Plot a sequence of numbers against the best one. The “best value” is plotted as a horizontal line.
- Parameters:
data – A sequence of points to be plotted. Each data[i] should be a 2-D point.
best_selector – A
Callablethat returns the best value indata. To plot a pre-determined, constant best value, letbest_selectoralways return that value.best_label – Label for the best value.
all_label – Label for other values.
Module contents
Utilities for plotting clusters of points. Initially designed to visualise swarm-based algorithms.