Skip to content

bitsequence environment#246

Merged
saleml merged 8 commits intoGFNOrg:masterfrom
Idriss-Malek:idriss_malek
Mar 29, 2025
Merged

bitsequence environment#246
saleml merged 8 commits intoGFNOrg:masterfrom
Idriss-Malek:idriss_malek

Conversation

@Idriss-Malek
Copy link
Contributor

No description provided.

@josephdviviano josephdviviano self-requested a review February 25, 2025 19:00

Notes:
- The method sets the random seed for both CPU and GPU (if available) to ensure reproducibility.
- The tensor H is initialized with predefined sequences if it is not already set. This default value is the one chosen in the TB objectie paper.
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo

Copy link
Collaborator

@saleml saleml left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Minor comments above!
Could you add a test to test_scripts.py that involve this new environment? It can be a few steps of SGD with TB loss or a loss of your choice, to ensure that it goes down, and matches some experiments you might have done with this environment. You could take inspiration from the other tests in the same file.

self.update_masks(new_states)
return new_states

def make_modes_set(self, seed: int = 42) -> torch.Tensor:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you explain in one or two sentences in the docstring how the modes are defined from H?

seq_size: int = 120,
n_modes: int = 60,
temperature: float = 1.0,
H: Optional[torch.Tensor] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe the seed of make_modes_set should be part of the init function of the environment. As of now, the user doesn't have any way to set the seed, and it will always be 42. BTW can you use 0 for default seed, as in the rest of the database? Interestingly, whenever an LLM is tasked of generating random code, it uses seed 42

@saleml saleml changed the title Idriss malek, bitsequence bitsequence environment Mar 14, 2025
Copy link
Collaborator

@saleml saleml left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, and the great PR. This is a useful addition to the library.

@saleml saleml merged commit d1ee492 into GFNOrg:master Mar 29, 2025
3 checks passed
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