Skip to content

Refactor CB trainers in reagent to integrate Offline Eval#694

Closed
alexnikulkov wants to merge 2 commits intofacebookresearch:mainfrom
alexnikulkov:export-D41239491
Closed

Refactor CB trainers in reagent to integrate Offline Eval#694
alexnikulkov wants to merge 2 commits intofacebookresearch:mainfrom
alexnikulkov:export-D41239491

Conversation

@alexnikulkov
Copy link
Contributor

Differential Revision: D41239491

@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D41239491

alexnik and others added 2 commits December 6, 2022 16:24
Differential Revision: D41226450

fbshipit-source-id: 4d19b8c113eea031a598ec515a477e247507100c
Summary:
1. Instead of inheriting CB trainers from `ReAgentLightningModule` (we weren't using any custom methods/attributed from this class), I created a separate `BaseCBTrainerWithEval` base class for all CB reagent trainers
2. `BaseCBTrainerWithEval` integrates Offline Eval into the training process. By default the behavior is same as before refactor. But after `.attach_eval_module()` method gets called, every batch is processed by the eval module before training on it. The processing includes keeping track of the reward and filtering the training batch.

Differential Revision: D41239491

fbshipit-source-id: f5c2bf64a9584e1f6a59d14bb5e07a40089ac93d
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D41239491

@facebook-github-bot
Copy link

This pull request has been merged in 7cb5500.

xuruiyang pushed a commit that referenced this pull request Sep 20, 2025
Summary:
Pull Request resolved: #694

`BaseCBTrainerWithEval` integrates Offline Eval into the training process. By default the behavior is same as before refactor. But after `.attach_eval_module()` method gets called, every batch is processed by the eval module before training on it. The processing includes keeping track of the reward and filtering the training batch.

Reviewed By: BerenLuthien

Differential Revision: D41239491

fbshipit-source-id: f5c506d14a736a71ddc1b64270d1e8842a23488b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants