GFNOrg / torchgfn

GFlowNet library
https://torchgfn.readthedocs.io/en/latest/
Other
209 stars 26 forks source link

Nit: `log_reward_clip_min` isn't defined in `gflownet/base.py` - it depends on definitions in the subclasses. #155

Closed josephdviviano closed 6 months ago

josephdviviano commented 6 months ago

in base.py

        log_rewards = trajectories.log_rewards
        # TODO: log_reward_clip_min isn't defined in base ().
        if math.isfinite(self.log_reward_clip_min) and log_rewards is not None:
            log_rewards = log_rewards.clamp_min(self.log_reward_clip_min)

this logic corresponds to an attribute only defined in subclasses. I don't think this is best practice, and the corresponding subclass logic should be centralized in base.py.

josephdviviano commented 6 months ago

PR created, closing.