plenoptic.plot.mad_loss_all#

plenoptic.plot.mad_loss_all(mad_metric1_min, mad_metric2_min, mad_metric1_max, mad_metric2_max, metric1_name=None, metric2_name=None, metric1_kwargs={'c': 'C0'}, metric2_kwargs={'c': 'C1'}, min_kwargs={'linestyle': '--'}, max_kwargs={'linestyle': '-'}, figsize=(10, 5))[source]#

Plot loss for full set of MAD Competiton instances.

To generate a full set of MAD Competition images, you need four instances: one for minimizing and maximizing each metric. This helper function creates a two-axis figure to display the loss for this full set.

Parameters:
  • mad_metric1_min (MADCompetition) – MADCompetition object that minimized the first metric.

  • mad_metric2_min (MADCompetition) – MADCompetition object that minimized the second metric.

  • mad_metric1_max (MADCompetition) – MADCompetition object that maximized the first metric.

  • mad_metric2_max (MADCompetition) – MADCompetition object that maximized the second metric.

  • metric1_name (str | None (default: None)) – Name of the first metric. If None, we use the name of the optimized_metric function from mad_metric1_min.

  • metric2_name (str | None (default: None)) – Name of the second metric. If None, we use the name of the optimized_metric function from mad_metric2_min.

  • metric1_kwargs (dict (default: {'c': 'C0'})) – Dictionary of arguments to pass to matplotlib.pyplot.plot to identify synthesis instance where the first metric was being optimized.

  • metric2_kwargs (dict (default: {'c': 'C1'})) – Dictionary of arguments to pass to matplotlib.pyplot.plot to identify synthesis instance where the second metric was being optimized.

  • min_kwargs (dict (default: {'linestyle': '--'})) – Dictionary of arguments to pass to matplotlib.pyplot.plot to identify synthesis instance where optimized_metric was being minimized.

  • max_kwargs (dict (default: {'linestyle': '-'})) – Dictionary of arguments to pass to matplotlib.pyplot.plot to identify synthesis instance where optimized_metric was being maximized.

  • figsize (tuple[int, int] (default: (10, 5))) – Size of the figure we create.

Return type:

Figure

Returns:

fig – Figure containing the plot.

Raises:

ValueError – If the four MADCompetition instances do not have the same image attribute.

See also

synthesis_loss

Display the loss from a single MADCompetition instance.

synthesis_status

Create a composite plot showing synthesis status of a single MADCompetition instance.

Examples

See the MAD Competition tutorial notebooks in the User Guide of documentation for examples.