-
Notifications
You must be signed in to change notification settings - Fork 34
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
Refactoring ideas regarding Sampler
#195
Comments
Yes, @saleml and I have had this conversation a few times before. I don't see a major downside of the The only downside I can see is this: if a user needs to subclass the I'm very open to integrating it. |
@hyeok9855 for this one - if you want to propose a PR that handles this merge I will be willing to review. However I am wary of unnecessarily merging everything into a few giant classes. This is exactly the sort of thing that makes the library harder for other people to extend for their own purposes. What we want is a level of modularity so that it's easy for people to subclass and extend only the required components for a new gflownet method to work. In this case, having our sampler be distinct from the gflownet is useless because there's only one kind of sampler. But I could imagine in the future having multiple kinds of samplers that are compatible with all of the gflownet modules. Does this make sense to you? |
Yes, that's a very good point. One possible example would be the local search (LS), where we may sample [batch_size * #LS_iterations] trajectories at an epoch. |
Maybe I could implement the |
I love this idea! |
See #208 for |
One thing to discuss regarding Currently, we can sample trajectories in two different ways:
I think this is redundant, so here are options to streamline:
I prefer option 2 because the Please share your ideas! |
There are two key components,
GFlowNet
(insrc/gfn/gflownet
) andSampler
(insrc/gfn/samplers.py
).I think
Sampler
is a redundant class, and we could get rid of it by incorporating the sampling logic inside of theGFlowNet
class.Specifically, this line defines a sampler object only to sample one batch of a trajectory, which can be replaced by a single method in
GFlowNet
class.The text was updated successfully, but these errors were encountered: