Conversation
src/gfn/gym/bitSequence.py
Outdated
|
|
||
| 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. |
saleml
left a comment
There was a problem hiding this comment.
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.
src/gfn/gym/bitSequence.py
Outdated
| self.update_masks(new_states) | ||
| return new_states | ||
|
|
||
| def make_modes_set(self, seed: int = 42) -> torch.Tensor: |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Thanks for the changes, and the great PR. This is a useful addition to the library.
No description provided.