ograph.applications package

Submodules

ograph.applications.swarm module

ograph.applications.swarm.plot_positions(data: Vec2D | Vec3D, objective: Callable[[float, float], float] | None = None, *, override_region: Vec2D | 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 data is 2-D: data[t] is a single point. Plot its change over time.

    • If data is 3-D: data[t] is a collection oof points. Plot the change of these points over time.

  • 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: Vec2D, best_selector: ~typing.Callable[[Vec2D], ~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 Callable that returns the best value in data. To plot a pre-determined, constant best value, let best_selector always 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.