Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove_nonterminal_branches #208

Merged
merged 2 commits into from
Jan 15, 2025
Merged

remove_nonterminal_branches #208

merged 2 commits into from
Jan 15, 2025

Conversation

sidnarayanan
Copy link
Collaborator

A method to create a tree with only terminal branches

@sidnarayanan sidnarayanan requested a review from a team January 15, 2025 00:44
@@ -336,6 +336,25 @@ def compute_advantages(self) -> None:
# See docstring for explanation.
# step.metadata["advantage"] = step.value - state_values[parent_id]

def remove_nonterminal_branches(self) -> TransitionTree:
"""Creates a new tree with only branches that end in terminal states."""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a comment stating failure is not considered here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Clarified done=True. Technically one could write a pathological environment in which both step.done and step.failed are true, and we'd include that branch in this method. So I don't want to claim we exclude failures.

@sidnarayanan sidnarayanan merged commit 67a55cc into main Jan 15, 2025
6 checks passed
@sidnarayanan sidnarayanan deleted the terminal-trees branch January 15, 2025 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants