{"record":{"id":"33ee3943c4131816","repo":"Unity-Technologies/ml-agents","slug":"the-reward-provider-s-evaluate-method-has-not-been","errorCode":null,"errorMessage":"The reward provider's evaluate method has not been implemented ","messagePattern":"The reward provider's evaluate method has not been implemented ","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"ml-agents/mlagents/trainers/torch_entities/components/reward_providers/base_reward_provider.py","lineNumber":58,"sourceCode":"    @property\n    def ignore_done(self) -> bool:\n        \"\"\"\n        If true, when the agent is done, the rewards of the next episode must be\n        used to calculate the return of the current episode.\n        Is used to mitigate the positive bias in rewards with no natural end.\n        \"\"\"\n        return self._ignore_done\n\n    @abstractmethod\n    def evaluate(self, mini_batch: AgentBuffer) -> np.ndarray:\n        \"\"\"\n        Evaluates the reward for the data present in the Dict mini_batch. Use this when evaluating a reward\n        function drawn straight from a Buffer.\n        :param mini_batch: A Dict of numpy arrays (the format used by our Buffer)\n            when drawing from the update buffer.\n        :return: a np.ndarray of rewards generated by the reward provider\n        \"\"\"\n        raise NotImplementedError(\n            \"The reward provider's evaluate method has not been implemented \"\n        )\n\n    @abstractmethod\n    def update(self, mini_batch: AgentBuffer) -> Dict[str, np.ndarray]:\n        \"\"\"\n        Update the reward for the data present in the Dict mini_batch. Use this when updating a reward\n        function drawn straight from a Buffer.\n        :param mini_batch: A Dict of numpy arrays (the format used by our Buffer)\n            when drawing from the update buffer.\n        :return: A dictionary from string to stats values\n        \"\"\"\n        raise NotImplementedError(\n            \"The reward provider's update method has not been implemented \"\n        )\n\n    def get_modules(self) -> Dict[str, torch.nn.Module]:\n        \"\"\"","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/Unity-Technologies/ml-agents/blob/3ecb446f75d1e7400eb404c562dc005d3164cffc/ml-agents/mlagents/trainers/torch_entities/components/reward_providers/base_reward_provider.py#L40-L76","documentation":"NotImplementedError raised in the abstract BaseRewardProvider.evaluate method. It is a template-method sentinel: the base class deliberately raises so that any reward provider subclass that does not override evaluate() fails loudly when the trainer tries to compute rewards from a buffer. The fault is a missing method implementation in the custom or mis-written subclass, not bad input data.","triggerScenarios":"Thrown at ml-agents/mlagents/trainers/torch_entities/components/reward_providers/base_reward_provider.py:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Implement evaluate(self, mini_batch: AgentBuffer) -> np.ndarray in every custom reward provider subclass, returning one reward value per entry in the batch","If using built-in providers (GAIL, Curiosity, RND...), ensure you instantiate the concrete class rather than BaseRewardProvider","Add unit tests that call evaluate() on the subclass to catch missing overrides early"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3ecb446f75d1e7400eb404c562dc005d3164cffc","analyzedAt":"2026-09-02T16:33:12.832Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}