duo_ai.algorithms.always ======================== .. py:module:: duo_ai.algorithms.always Classes ------- .. autoapisummary:: duo_ai.algorithms.always.AlwaysAlgorithmConfig duo_ai.algorithms.always.AlwaysAlgorithm Module Contents --------------- .. py:class:: AlwaysAlgorithmConfig Configuration for the AlwaysAlgorithm, which always returns the same action. :param name: Name of the algorithm class. Default is "always". :type name: str, optional .. rubric:: Examples >>> config = AlwaysAlgorithmConfig() .. py:attribute:: name :type: str :value: 'always' .. py:class:: AlwaysAlgorithm(config: AlwaysAlgorithmConfig) Bases: :py:obj:`duo_ai.core.algorithm.Algorithm` Algorithm that always returns the same action, regardless of input. .. rubric:: Examples >>> algo = AlwaysAlgorithm(AlwaysAlgorithmConfig()) .. py:attribute:: config_cls .. py:method:: train(policy: duo.core.Policy, env: gym.Env, validators: Dict[str, duo.core.Evaluator]) -> None Run the AlwaysAlgorithm training procedure. This method evaluates the provided policy in the given environment using the specified evaluators. The AlwaysAlgorithm always returns the same action, regardless of the input observation. :param policy: The policy instance to use for generating actions. :type policy: duo.core.Policy :param env: The environment in which the policy is evaluated. :type env: gym.Env :param validators: Dictionary mapping split names to evaluator instances for evaluation. :type validators: dict of str to duo.core.Evaluator :rtype: None .. rubric:: Examples >>> algorithm = AlwaysAlgorithm(AlwaysAlgorithmConfig()) >>> algorithm.train(policy, env, validators)