Skip to content

[Doc] Document CatFrames with collectors and image replay buffers - #4229

Open
YeonwooSung wants to merge 1 commit into
pytorch:mainfrom
YeonwooSung:doc/2618-catframes-collector-replay
Open

[Doc] Document CatFrames with collectors and image replay buffers#4229
YeonwooSung wants to merge 1 commit into
pytorch:mainfrom
YeonwooSung:doc/2618-catframes-collector-replay

Conversation

@YeonwooSung

Copy link
Copy Markdown
Contributor

Description

Adds a focused Sphinx recipe for using CatFrames with a data collector and a replay buffer on images, which was missing from the reference docs.

Two legitimate placements are documented and cross-linked:

  • Env-side (docs/source/reference/envs_transforms.rst): stateful stacking for the policy, reset / InitTracker behavior, and dim=-3 for CHW images.
  • Buffer-side (docs/source/reference/data_replaybuffers.rst): store unstacked raw pixels, rebuild the stack in rb.sample(), and wire a Collector through extend / sample. Shows both CatFrames.make_rb_transform_and_sampler and the explicit SliceSampler form.

The recipe also covers why raw uint8 frames are what you store, how the collector's ("collector", "traj_ids") interact with the slice sampler, and the common pitfalls of stacking twice (env and buffer on the same key) or using the vector default dim=-1 on pixels.

Copy-paste snippets use # doctest: +SKIP where gym / pixel rendering is required. The CatFrames class docstring now points at both sections.

Motivation and Context

Using CatFrames for inference was already documented; reconstructing a frame stack when sampling from a replay buffer was not, especially for images (stack dim -3, not the vector default). Visual RL relies on this pattern, and the collector + extend + sample path is easy to get wrong (double stacking, wrong dim, no time axis).

close #2618

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

Types of changes

What types of changes does your code introduce? Remove all that do not apply:

  • Documentation (update in the documentation)

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • 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 Sep 5, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 4 New Failures, 3 Cancelled Jobs

As of commit ebc3714 with merge base 1d3de3d (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

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 Sep 5, 2026
@github-actions github-actions Bot added Documentation Improvements or additions to documentation Transforms labels Sep 5, 2026
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. Documentation Improvements or additions to documentation Transforms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Provide documentation on how to use CatFrames with a data collector and replay buffer for images

1 participant