ai4co / rl4co

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

[Feat] Add MVMoE model #181

Closed RoyalSkye closed 5 months ago

RoyalSkye commented 5 months ago

Description

This PR adds support for MVMoE in the multi-task VRP setting. In specific, the token-level input-choice gating is implemented. Some minor bugs are fixed as well, such as missing the definition of MTVRPInitEmbedding and MTVRPContext.

Motivation and Context

A step towards foundation VRP models.

Types of changes

What types of changes does your code introduce? Remove all that do not apply:

Checklist

Go over all the following points, and put an x in all the boxes that apply. If you are unsure about any of these, don't hesitate to ask. We are here to help!

RoyalSkye commented 5 months ago

I have added an example to 1-mtvrp.ipynb. It seems that the notebook has some issues on my laptop, so I just uploaded a raw version without output ๐Ÿš€.

fedebotu commented 5 months ago

It seems that the notebook has some issues on my laptop, so I just uploaded a raw version without output

Are you using an M-series Macbook? We had some problems only with MTVRP and only with Apple MPS accelerators :rofl:

cbhua commented 5 months ago

The notebook works smoothly for me! If it has some bug on a Macbook, it's only could be the problem with the M chip ๐Ÿ˜‚ We had experiences on this.

RoyalSkye commented 5 months ago

Maybe this is the reason๐Ÿ˜‚. Could you help me to upload a new version that overwrites the current one? Thanks!

RoyalSkye commented 5 months ago

Thank Chuanbo. Looks great! I have nothing to add to this PR.

cbhua commented 5 months ago

Great job! After @LTluttmann having a look let's launch! ๐Ÿš€

LTluttmann commented 5 months ago

awesome work! Clean and well documented code, was a pleasure to read it haha! Merging now