facebookresearch / neural-rewriter Goto Github PK
View Code? Open in Web Editor NEWLearning to Perform Local Rewriting for Combinatorial Optimization
License: Other
Learning to Perform Local Rewriting for Combinatorial Optimization
License: Other
花了几天时间通读了代码,并做了一下复现,有一些疑问:
1.首先吐槽一下代码,代码很像一个对torch不熟悉的人写的。里面为了实现batch并行处理的目的,用了很多for循环,很多地方写的好naive。。。
2.所以这个代码真的是你们的最终版嘛?很多路径和文件不应该自己创建嘛?run了以后才知道要手动去自己建一些文件和路径?真的是认真的嘛?
2.关于训练时间,由于你代码用了很多while和for的嵌套,虽然看上去想实现batch并行,但本质却没有反而增加了代码的复杂度,所以我很好奇你们论文的效果训练了多久?我在5条2080ti的服务器上测试了一下vrp,就算是64的batch_size,train的真的很慢,而且前期波动性就很大。这很不符合用深度方法做这这类问题的前期的表现(下面的repo与你们对比鲜明)。如果按你们default的参数设置,10w个点,200epoch,难道真要训练好几个月?
3.可以看一下去年NIPS的《reinforcement-learning-for-solving-the-vehicle-routing-problem》和19的ICLR《ATTENTION, LEARN TO SOLVE ROUTING PROBLEMS!》的代码和实验效果,他们的复现结果都很好,虽然方法不一样。
4.所以最后还是想问一句,这真的是你们论文结果的代码吗?
For data generator, there is "jsp_r20"
argParser.add_argument('--res_file', type=str, default='../data/jsp/jsp_r20_short_job.json') argParser.add_argument('--res_train_file', type=str, default='../data/jsp/jsp_r20_train_short_job.json') argParser.add_argument('--res_val_file', type=str, default='../data/jsp/jsp_r20_val_short_job.json') argParser.add_argument('--res_test_file', type=str, default='../data/jsp/jsp_r20_test_short_job.json')
For data loader, there is "jsp_r10"
elif title == 'jsp': data_group.add_argument('--train_dataset', type=str, default='../data/jsp/jsp_r10_train.json') data_group.add_argument('--val_dataset', type=str, default='../data/jsp/jsp_r10_val.json') data_group.add_argument('--test_dataset', type=str, default='../data/jsp/jsp_r10_test.json')
It seems like that dropout is disabled in your code. And is it better not to set dropout in MLP? Thanks.
Couldn't these lines:
neural-rewriter/src/models/jspModel.py
Lines 219 to 225 in 306d02c
be rewritten like that:
pred_rewards = self.value_estimator(torch.cat(node_embeddings, 0))
Rather than building final pred_rewards tensor gradually within for-loop? Does it make sense for Pytorch autograd or stuff like that?
I don't understand why to use "Max"? I have sent an email to you, but I haven't got your reply yet。 And I really hope to get your answer.
First of all, thank you for the great work and open source code.
However, I am trying to run the Neural Rewriter and couldn't match the runtime reported in the paper.
For vrp100, the runtime is 7s for one instance (max_reduce_steps = 200), longer than the 0.398s reported in the paper.
For jsp (max_reduce_steps = 50, num_res = 10), the runtime per instance is 0.61s, which is longer than the 0.037s reported in the paper.
jspModel.batch_rewrite costs 70% of the time. The performance is matching. I am using python 3.6.9, torch 1.9.0, processes=1 and one GPU to infer.
Any help will be appreciated.
I don't understand why coding like that. The paper says, if B_j = A_j, add <v_0, v_j>, else C_j' = B_j, add<v_j', v_j>. So why add edge between the nodes whose schedule time are same? And what's the meaning of schedule_idx?
Besides, in this paper, about Figure 2(b), why there is no edge between node 1 and node 5? I think there should be an edge in terms of your DAG representation. Thanks in advance.
Hi authors,
I am trying to train for the JSP task with the default hyperparameters in code (64 batch size and 5e-5 learning rate), hyperparameters in your paper (128 batch size and 1e-4 learning rate) and other settings. After one epoch and more, I am afraid the loss and reward of my training are not converged. Since the training for one epoch takes a long time in my workstation, it is very frustrating.
Now I created a colab. Could you please take a look and give me some help. I will appreciate it.
I feel confusing about the Halide dateset. Where can I get the Random pipeline generator?
Thanks!
The line 284 of vrpModel.py is inconsistent with the expression of paper(overall loss function), but jspModel.py and HalideModel.py are consistent with the paper(overall loss function)
I use the default settings in the codes to generate the data and to train the model for vrp20 and vrp50 (for vrp50, I reduced the batch size by half (64->32) so as to run in one GPU), but it seemed that in training, the rewards remain at a high level and can't converge.
And after running the whole 10 epoches, I evaluated the model (with max_reduce_steps=200 and other default settings), also found that the avg reward for vrp20 is 6.7 and vrp50 is 12.6, far from the reported reward in your paper (6.16 and 10.51, respectively).
Is there anything I may have missed? I'd appreciate it if you could offer some help!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.