.view() on run_time messed up the run times (interleaving instead of stacking behavior)
reward missed the "-" sign
added inline comments
implemented render function
implemented a mechanism allowing for N POMO starts. Other than the original implementation, this works for arbitrary instances (instead of assuming 3 stages with 4 machines each)
implemented a "flatten" option, which flattens out the stage dimension. This allows the use of the (single-stage) MatNet model
updated MatNet test
MatNet
implemented the multi-stage MatNet Model for the FFSP as described in the original MatNet paper
implemented a single-stage MatNet model for the FFSP. This has the advantage over the original implementation that it is size-agnostic. The multi-stage model can only be applied to instances with a fixed number of stages. The performance of the single-stage model is still under evaluation.
added function which, based on the environment, selects the correct MatNet policy
MatNetCrossMHA:
changed some default parameters in accordance to the official paper implementation
LogitAttention:
changed the keyword argument "linear_bias" to "out_bias", since "linear_bias" is already used in AutoregressiveDecoder. Thus, LogitAttention's linear_bias could not be changed without changing that of the AutoregressiveDecoder.
nn.env_embeddings:
added context, init and dynamic emebddings for FFSP
replaced the MatNetATSPInitEmbedding with a more generic MatNetInitMebedding (works for ATSP and FFSP)
POMO:
added "max_reward" to td also during training (for logging purposes)
RL4COEnvBase:
added get_num_starts and select_start_nodes as functions to the environment. By default, the get_num_starts select_start_nodes from the rl4co.utils.ops module are called (w.i.p.), but environments can override these functions with custom logic (example in FFSPEnv).
removed select_start_nodes_fn attribute from AutoregressiveDecoder. Note, that it can still be manually set by passing the select_start_nodes_fn argument to the forward function of the decoder (which hands it over to the DecodingStrategy)
[ ] I have raised an issue to propose this change (required for new features and bug fixes)
Types of changes
What types of changes does your code introduce? Remove all that do not apply:
[x] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds core functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Documentation (update in the documentation)
[ ] Example (update in the folder of examples)
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!
[ ] My change requires a change to the documentation.
[x] I have updated the tests accordingly (required for a bug fix or a new feature).
Description
FFSPEnv:
MatNet
MatNetCrossMHA:
LogitAttention:
nn.env_embeddings:
POMO:
RL4COEnvBase:
config (main.yaml):
Motivation and Context
Added working FFSP MatNet implementation
improvements and fixes for FFSP environment
let get_num_starts and select_start_nodes functions be implemented by environments as discussed here: https://github.com/ai4co/rl4co/discussions/117
some minor fixes
[ ] I have raised an issue to propose this change (required for new features and bug fixes)
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!