Skip to content

[Feature] Add TD3Trainer with config system integration - #3557

Merged
vmoens merged 10 commits into
pytorch:mainfrom
bsprenger:bsprenger/feat/td3trainer
Mar 23, 2026
Merged

vmoens merged 10 commits into
pytorch:mainfrom
bsprenger:bsprenger/feat/td3trainer

Conversation

@bsprenger

@bsprenger bsprenger commented Mar 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This commit adds a TD3Trainer, implementing the TD3 algorithm (twin delayed DDPG) via the trainer framework.

Motivation and Context

The trainer framework already implements many of the most common algorithms. However, TD3 is notably missing.

This commit therefore adds:

  • the TD3Trainer class
  • config dataclasses for the trainer and loss function, integrated with the hydra-based config framework
  • A SOTA example (HalfCheetah-v4)

Running the SOTA example with the default configuration produces results shown in the following GIF:

video_None_743424

  • I have raised an issue to propose this change (required for new features and bug fixes)

Closes: #3558

Types of changes

  • New feature (non-breaking change which adds core functionality)
  • Example (update in the folder of examples)

Checklist

  • I have read the CONTRIBUTION guide (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.

@pytorch-bot

pytorch-bot Bot commented Mar 23, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/3557

Note: Links to docs will display an error until the docs builds have been completed.

❌ 6 New Failures, 1 Cancelled Job, 1 Unrelated Failure

As of commit ccac61d with merge base 4e2e787 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ PR Title Label Error

Unknown or invalid prefix [Trainer].

Current title: [Trainer] Add TD3Trainer with config system integration

Supported Prefixes (case-sensitive)

Your PR title must start with exactly one of these prefixes:

Prefix Label Applied Example
[BugFix] BugFix [BugFix] Fix memory leak in collector
[Feature] Feature [Feature] Add new optimizer
[Doc] or [Docs] Documentation [Doc] Update installation guide
[Refactor] Refactoring [Refactor] Clean up module imports
[CI] CI [CI] Fix workflow permissions
[Test] or [Tests] Tests [Tests] Add unit tests for buffer
[Environment] or [Environments] Environments [Environments] Add Gymnasium support
[Data] Data [Data] Fix replay buffer sampling
[Performance] or [Perf] Performance [Performance] Optimize tensor ops
[BC-Breaking] bc breaking [BC-Breaking] Remove deprecated API
[Deprecation] Deprecation [Deprecation] Mark old function
[Quality] Quality [Quality] Fix typos and add codespell

Note: Common variations like singular/plural are supported (e.g., [Doc] or [Docs]).

@bsprenger bsprenger changed the title [Trainer] Add TD3Trainer with config system integration [Feature] Add TD3Trainer with config system integration Mar 23, 2026
@github-actions github-actions Bot added the Feature New feature label Mar 23, 2026
@bsprenger bsprenger mentioned this pull request Mar 23, 2026
1 task done

@vmoens vmoens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks for this!

@vmoens
vmoens merged commit cd42542 into pytorch:main Mar 23, 2026
132 of 144 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Feature New feature sota-implementations/ Trainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Implement TD3Trainer

2 participants