:py:mod:`fragile.optimize.evotorch` =================================== .. py:module:: fragile.optimize.evotorch .. autoapi-nested-parse:: This modes implements an interfacing with the `evotorch` library. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: fragile.optimize.evotorch.EvotorchEnv .. py:class:: EvotorchEnv(algorithm, function = None, bounds = None, **kwargs) Bases: :py:obj:`fragile.core.env.Function` This environment implements an interface with the `evotorch` library. When providing an instance of an evotorch :class:`Searcher` it will wrap it and allow to use all the fragile features on top of evotorch, such as plotting, custom policies, etc. .. py:attribute:: default_inputs .. py:attribute:: default_outputs :annotation: = ['observs', 'rewards', 'oobs'] .. py:method:: algorithm() :property: Return the evotorch :class:`SearchAlgorithm` instance used by this environment. .. py:method:: population() :property: Access the :class:`SolutionBatch` instance used by the evotorch :class:`SearchAlgorithm`. .. py:method:: problem() :property: Access the :class:`Problem` instance used by the evotorch :class:`SearchAlgorithm`. .. py:method:: dtype() :property: Access the dtype used by the evotorch :class:`SearchAlgorithm` for the solution values. .. py:method:: eval_dtype() :property: Access the dtype used by the :class:`SearchAlgorithm` for the solution evaluations. .. py:method:: solution_length() :property: Access the length of the solution used by the evotorch :class:`SearchAlgorithm`. .. py:method:: _get_bounds() Initialize the :class:`Bounds` instance used by this environment. Extract all the information about the dimensionality and data type of the solutions from the problem instance used by the evotorch :class:`SearchAlgorithm`. .. py:method:: _get_function() Return a function that sets the values of the evotorch :class:`SolutionBatch` with the provided points and iterates the evotorch :class:`SearchAlgorithm` to obtain new solutions. .. py:method:: step(actions, observs, **kwargs) Sum the target action to the observations to obtain the new points, and evaluate the reward and boundary conditions. :returns: Dictionary containing the information of the new points evaluated. ``{"observs": new_points, "rewards": scalar array, "oobs": boolean array}`` .. py:method:: reset(inplace = True, root_walker = None, states = None, **kwargs) Reset the :class:`Function` to the start of a new episode and updates its internal data.