Reward func multi wrapper
Air Force Research Laboratory (AFRL) Autonomous Capabilities Team (ACT3) Reinforcement Learning (RL) Core.
This is a US Government Work not subject to copyright protection in the US.
The use, dissemination or disclosure of data in this file is subject to limitation or restriction. See accompanying README and LICENSE for details.
BaseMultiWrapperReward (RewardFuncBase)
¤
A base object that rewards can inherit in order to "wrap" multiple reward instances
Source code in corl/rewards/reward_func_multi_wrapper.py
class BaseMultiWrapperReward(RewardFuncBase):
"""A base object that rewards can inherit in order to "wrap" multiple reward instances
"""
def __init__(self, **kwargs) -> None:
self.config: BaseMultiWrapperRewardValidator
super().__init__(**kwargs)
@property
def get_validator(self) -> typing.Type[BaseMultiWrapperRewardValidator]:
return BaseMultiWrapperRewardValidator
def rewards(self) -> typing.List[RewardFuncBase]:
"""Get the wrapped reward instances
"""
return self.config.wrapped
@abc.abstractmethod
def __call__(
self,
observation: OrderedDict,
action,
next_observation: OrderedDict,
state: StateDict,
next_state: StateDict,
observation_space: StateDict,
observation_units: StateDict,
) -> RewardDict:
...
get_validator: Type[corl.rewards.reward_func_multi_wrapper.BaseMultiWrapperRewardValidator]
property
readonly
¤
Returns pydantic validator associated with this class
rewards(self)
¤
Get the wrapped reward instances
Source code in corl/rewards/reward_func_multi_wrapper.py
def rewards(self) -> typing.List[RewardFuncBase]:
"""Get the wrapped reward instances
"""
return self.config.wrapped
BaseMultiWrapperRewardValidator (RewardFuncBaseValidator)
pydantic-model
¤
wrapped - the wrapped reward instances
Source code in corl/rewards/reward_func_multi_wrapper.py
class BaseMultiWrapperRewardValidator(RewardFuncBaseValidator):
"""
wrapped - the wrapped reward instances
"""
wrapped: typing.List[RewardFuncBase]
class Config: # pylint: disable=C0115, R0903
arbitrary_types_allowed = True