Skip to content

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

Open
dstrodtman wants to merge 1 commit into
ray-project:masterfrom
dstrodtman:doc-981-dqn-dueling-docstring
Open

[Docs] Clarify DQN hiddens docstring as dueling-only (#43051)#63444
dstrodtman wants to merge 1 commit 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) <noreply@anthropic.com>
Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
@dstrodtman dstrodtman requested a review from a team as a code owner May 18, 2026 16:00
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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
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 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>]

1 participant