.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/01_basics/plot_03_problem_zoo.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_01_basics_plot_03_problem_zoo.py: Search spaces and the problem zoo ================================= An IEC problem has three parts: a *search space* (a :class:`~easyiec.Box` of real, integer, log-scaled and categorical genes), a *rendering* that turns a genome into something a person can judge, and optionally a ground-truth *utility* that simulated users and benchmarks use. easyiec ships 25 problems from engineering, image processing, generative art, design, music and text. .. GENERATED FROM PYTHON SOURCE LINES 13-16 A search space -------------- Strategies work in the unit cube; the box maps to and from the physical units. .. GENERATED FROM PYTHON SOURCE LINES 16-32 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np import easyiec as ei from easyiec.problems import list_problems, make space = ei.Box( lower=[0.1, 1.0, 0, 0], upper=[10.0, 100.0, 5, 3], names=["gain", "time_constant", "filter_order", "mode"], kinds=["real", "real", "int", "cat"], log=[True, True, False, False], categories={3: ["P", "PI", "PID"]}, units=["", "s", "", ""], ) x = space.denormalize(np.array([0.5, 0.5, 0.5, 0.9])) print(space.describe(x)) # gain and time constant at the geometric mean .. rst-class:: sphx-glr-script-out .. code-block:: none - gain = 1 (range 0.1 .. 10) - time_constant = 10 s (range 1 .. 100) - filter_order = 2 (range 0 .. 5) - mode = PID (range 0 .. 3) .. GENERATED FROM PYTHON SOURCE LINES 33-37 The problem zoo --------------- :func:`~easyiec.problems.list_problems` lists the registry; every problem renders a random genome in the same way, so a gallery can show any of them. .. GENERATED FROM PYTHON SOURCE LINES 37-55 .. code-block:: Python table = list_problems() print(table[["name", "domain", "genes", "modality"]].to_string(index=False)) names = list(table["name"]) rng = np.random.default_rng(7) ncols = 6 nrows = int(np.ceil(len(names) / ncols)) fig, axes = plt.subplots(nrows, ncols, figsize=(1.55 * ncols, 1.75 * nrows)) for ax, name in zip(axes.flat, names): p = make(name) x = p.presets().get("default", p.random(rng)) ax.imshow(p.to_image(x, 160)) ax.set_title(p.name, fontsize=7) ax.axis("off") for ax in list(axes.flat)[len(names):]: ax.axis("off") fig.tight_layout() plt.show() .. image-sg:: /auto_examples/01_basics/images/sphx_glr_plot_03_problem_zoo_001.png :alt: synthetic, curve, pid, cstr, beer, fuzzy, path, photo, segmentation, julia, attractor, ifs, flame, cppn, harmonograph, biomorph, lsystem, automaton, supershape, palette, chart, face, graph, melody, slogan :srcset: /auto_examples/01_basics/images/sphx_glr_plot_03_problem_zoo_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none name domain genes modality synthetic benchmark 5 image curve benchmark 8 image pid process control 5 image cstr process control 4 image beer process engineering 6 image fuzzy fuzzy modelling 10 image path robotics 10 image photo image processing 11 image segmentation image processing 7 image julia generative art 10 image attractor generative art 10 image ifs generative art 27 image flame generative art 44 image cppn generative art 99 image harmonograph generative art 16 image biomorph artificial life 11 image lsystem artificial life 10 image automaton complex systems 11 image supershape graphic design 13 image palette graphic design 15 image chart data visualization 11 image face human perception 13 image graph network science 10 image melody music 19 image slogan communication text text .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.941 seconds) .. _sphx_glr_download_auto_examples_01_basics_plot_03_problem_zoo.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/ComplexSystemsIntelligence/easyiec/main?urlpath=lab/tree/notebooks/auto_examples/01_basics/plot_03_problem_zoo.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_03_problem_zoo.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_03_problem_zoo.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_03_problem_zoo.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_