Skip to content

[Docs] Clarify DQN hiddens docstring as dueling-only (#43051) - #63444

Merged
elliot-barn merged 2 commits into
ray-project:masterfrom
dstrodtman:doc-981-dqn-dueling-docstring
Jun 2, 2026
Merged

elliot-barn merged 2 commits into
ray-project:masterfrom
dstrodtman:doc-981-dqn-dueling-docstring

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Description

The hiddens parameter in rllib/algorithms/dqn/dqn.py only applies to the advantage and value branches of a dueling DQN, but the docstring did not say so. As a result, users could confuse it with model.fcnet_hiddens (see linked issue). This PR appends "in a dueling architecture" to the docstring to make the scope explicit.

Related issues

Closes #43051

[DOC-981]

Additional information

Target file: rllib/algorithms/dqn/dqn.py (the hiddens entry in the training argument list).

Generated with Claude Code

The hiddens parameter in rllib/algorithms/dqn/dqn.py only applies to the
advantage and value branches of a dueling DQN. Append "in a dueling
architecture" to the docstring so users do not confuse it with
model.fcnet_hiddens.

Closes ray-project#43051

[DOC-981]

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman requested a review from a team as a code owner May 18, 2026 16:00

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the docstring for the hiddens parameter in the DQN training method. The reviewer noted that the new description is misleading because the parameter is used regardless of whether a dueling architecture is enabled. Furthermore, the feedback identifies a typo in the docstring and an incorrect type hint in the method signature that requires a fix.

dueling: Whether to use dueling DQN.
hiddens: Dense-layer setup for each the advantage branch and the value
branch
branch in a dueling architecture.

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.

medium

The addition "in a dueling architecture" is technically misleading. In the current DQN implementation (both for PyTorch and TensorFlow), the hiddens parameter is also used to define the hidden layers of the single Q-network head when dueling=False. Specifying it as dueling-only might lead users to believe the parameter is ignored in non-dueling configurations. Additionally, there is a typo in the preceding line (307): "each the" should be "each of the" or just "the". Finally, please note that the type hint for hiddens in the training method signature (line 231) is Optional[int], but it should be Optional[List[int]] to match its usage and initialization.

@ray-gardener ray-gardener Bot added rllib RLlib related issues docs An issue or change related to documentation labels May 18, 2026
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions Bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jun 2, 2026
@dstrodtman dstrodtman added go add ONLY when ready to merge, run all tests and removed stale The issue is stale. It will be closed within 7 days unless there are further conversation labels Jun 2, 2026
@elliot-barn
elliot-barn merged commit 059934b into ray-project:master Jun 2, 2026
4 checks passed
rueian pushed a commit to rueian/ray that referenced this pull request Jun 4, 2026
…) (ray-project#63444)

## Description

The `hiddens` parameter in `rllib/algorithms/dqn/dqn.py` only applies to
the advantage and value branches of a dueling DQN, but the docstring did
not say so. As a result, users could confuse it with
`model.fcnet_hiddens` (see linked issue). This PR appends "in a dueling
architecture" to the docstring to make the scope explicit.

## Related issues

Closes ray-project#43051

[DOC-981]

## Additional information

Target file: `rllib/algorithms/dqn/dqn.py` (the `hiddens` entry in the
`training` argument list).

Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
limarkdcunha pushed a commit to limarkdcunha/ray that referenced this pull request Jun 30, 2026
…) (ray-project#63444)

## Description

The `hiddens` parameter in `rllib/algorithms/dqn/dqn.py` only applies to
the advantage and value branches of a dueling DQN, but the docstring did
not say so. As a result, users could confuse it with
`model.fcnet_hiddens` (see linked issue). This PR appends "in a dueling
architecture" to the docstring to make the scope explicit.

## Related issues

Closes ray-project#43051

[DOC-981]

## Additional information

Target file: `rllib/algorithms/dqn/dqn.py` (the `hiddens` entry in the
`training` argument list).

Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…) (ray-project#63444)

## Description

The `hiddens` parameter in `rllib/algorithms/dqn/dqn.py` only applies to
the advantage and value branches of a dueling DQN, but the docstring did
not say so. As a result, users could confuse it with
`model.fcnet_hiddens` (see linked issue). This PR appends "in a dueling
architecture" to the docstring to make the scope explicit.

## Related issues

Closes ray-project#43051

[DOC-981]

## Additional information

Target file: `rllib/algorithms/dqn/dqn.py` (the `hiddens` entry in the
`training` argument list).

Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: 400Ping <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs An issue or change related to documentation go add ONLY when ready to merge, run all tests rllib RLlib related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Poor description in DQN Dueling hidden property [<ray.rllib.algorithms.dqn.dqn>]

3 participants