ai4co / rl4co

A PyTorch library for all things Reinforcement Learning (RL) for Combinatorial Optimization (CO)
https://rl4.co
MIT License
386 stars 71 forks source link

[BugFix] Batch size for data generation #128

Closed aziabatz closed 6 months ago

aziabatz commented 6 months ago

Description

This PR addresses an issue that appears when generating the data for an environment. The problem was that the whole dataset size was used for training, validation, and testing, instead of the specified batch sizes.

Motivation

Using total dataset sizes led memory allocation problems during environment setup. By switching to batch sizes, we assure that the data we handle has the right size.

Types of Changes

Checklist

fedebotu commented 6 months ago

Please let us know if you find some better way of describing variable, right now the behavior is correct but naming might be confusing @aziabatz

cbhua commented 6 months ago

Thanks for reporting your concern @aziabatz. I think the variable name of batch_size in rl4co/envs/common/base.py is misleading. This batch_size actually is the problem size for the whole train/valid phase. We could revise this variable if necessary.