recursionpharma / gflownet

GFlowNet library specialized for graph & molecular data
MIT License
211 stars 41 forks source link

Shape of 'non_edge_index' in 'mol_building_env' causes invalid_losses > 0 #137

Open hohyun312 opened 2 months ago

hohyun312 commented 2 months ago

https://github.com/recursionpharma/gflownet/blob/f106cdeb6892214cbb528a3e06f4c721f4003175/src/gflownet/envs/mol_building_env.py#L355

While running test tasks on 'mol_building_env', I encountered 'invalid_losses'. After investigating, I discovered that the shape of non_edge_index was incorrect. This issue can be easily fixed by setting non_edge_index = np.zeros((0, 2), dtype=np.int64). The correct shape is needed for line 382, where non_edge_index.shape[0] is used.