{"record":{"id":"aa7a18a25b4ccce9","repo":"Unity-Technologies/ml-agents","slug":"the-reward-provider-s-update-method-has-not-been-i","errorCode":null,"errorMessage":"The reward provider's update method has not been implemented ","messagePattern":"The reward provider's update 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":71,"sourceCode":"        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        \"\"\"\n        Returns a dictionary of string identifiers to the torch.nn.Modules used by\n        the reward providers. This method is used for loading and saving the weights\n        of the reward providers.\n        \"\"\"\n        return {}\n","sourceCodeStart":53,"sourceCodeEnd":82,"githubUrl":"https://github.com/Unity-Technologies/ml-agents/blob/3ecb446f75d1e7400eb404c562dc005d3164cffc/ml-agents/mlagents/trainers/torch_entities/components/reward_providers/base_reward_provider.py#L53-L82","documentation":"NotImplementedError raised in the abstract BaseRewardProvider.update method. It is a template-method sentinel: the base class intentionally raises so any reward provider subclass that does not override update() fails when the trainer attempts its update pass over a mini-batch. The fault is a missing override in the subclass; the message text also erroneously says 'evaluate' even though it guards the update path.","triggerScenarios":"Thrown at ml-agents/mlagents/trainers/torch_entities/components/reward_providers/base_reward_provider.py:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Implement update(self, mini_batch: AgentBuffer) -> Dict[str, np.ndarray] in the reward provider subclass, returning at least the loss statistics","Instantiate a concrete built-in provider (GAIL, Curiosity, RND...) instead of the base class","Cover the subclass with a test that performs one update step to catch missing overrides"],"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"}