Answers.Body: <p>Deep learning models for regression tasks are quite difficult to train so I would suggest not to start with them. Instead I would start with one of the approaches below and maybe try to use deep learning afterwards.</p>
  
  <p>A classical approach to the problem could be to analyze your optimization software and this would probably lead you to some deterministic algorithm.</p>
  
  <p>Different approaches can be to treat your optimization software as a black box - give it a wide variety of inputs, note down the variables you are interested in (execution time, cutting results, etc.) and try to fit some sort or regressor on it. </p>
  
  <p>One option is to follow Kourosh's idea and formulate it as a classical optimization problem.</p>
  
  <p>If you prefer to use machine learning tools than I'd suggest that you start with a simple model like linear regression just to verify that there is any signal in the data that you can use. Afterwards you can look at more powerful algorithms like xgboost, regression trees, etc.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T12:27:47.347Z
Answers.LastActivityDate: 2017-11-07T12:27:47.347Z
Answers.UserDisplayName: ginge
Body: <p>I'm am quite new to deep learning but I think I found just the right real-world situation to start using it. The problem is that I have only used such algorithms to predict outcomes.  For my new project, I need information to feed a machine with to <em>optimize</em> outcomes. Could someone explain briefly how I should proceed? I'm stuck.</p>
  
  <p><strong>Here's the situation:</strong></p>
  
  <p>I have a machine that takes planks of wood with different grades of wood available throughout its length and has to cut it into blocks provided in a cut list. This machine will always choose the highest <em>score</em> it can get from a given plank. The <em>score</em> is obtained by multiplying each block's <em>area</em> by its <em>multiplicator</em>. The algorithm I want to build has to give that machine a <em>multiplicator</em> for each block listed in a cut list. All of the physical output from this machine will be stocked on shelves by a robot until needed. The cutting machine is allowed to downgrade parts of a plank if it helps it reach a higher score.</p>
  
  <p>The value has to act as an incentive for the machine to give me the block I need the most without downgrading too much wood.</p>
  
  <p><strong><em>OPTIMIZATION GOALS</em></strong></p>
  
  <ul>
  <li>Make sure each block is in stock by the time it is needed, but not too early without reason</li>
  <li>Downgrade as little area of wood as possible (some species are very expensive)</li>
  </ul>
  
  <p><strong><em>INPUT NODES</em></strong></p>
  
  <ul>
  <li>Amount of time before this block is needed</li>
  <li>Grade of wood for this block</li>
  <li>Amount of this block needed</li>
  <li>Block's area (Maybe?)</li>
  </ul>
  
  <p><strong><em>FEEDBACK PROVIDED TO THE ALGORITHM</em></strong></p>
  
  <ul>
  <li>Amount of time in advance that the block was ready (must be as low as possible)</li>
  <li>Area of wood downgraded * number of grades skipped</li>
  </ul>
  
  <p><strong><em>EXPECTED RETURN DATA</em></strong></p>
  
  <ul>
  <li>A <em>multiplicator</em> that will give that block an optimal its priority relative to others</li>
  </ul>
  
  <p><strong><em>INFORMATION I DON'T HAVE BUT COULD GATHER</em></strong></p>
  
  <ul>
  <li>Mean ratio of each grade for each species of wood</li>
  </ul>
  
  <p>What I've figured out so far is that I may need my feedback to be smashed in only one value in order to make it the output node. The problem is that I can't understand how to make this algorithm to determine a <em>multiplicator</em>. Am I wrong in trying to solve this through deep learning?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-31T20:09:10.537Z
Comments.Text: I took the liberty of editing the question for more clarity.  Wasn't sure what to do with: *"Value per cm² that will give that block an optimal its priority relative to others"*  Do you mean giving a block an optimal value in regard to its priority relative to other blocks?
Comments.UserDisplayName: DukeZhou
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-31T20:41:52.807Z
Comments.Text: @DukeZhou The machine's algorithm multiplies the value i'm trying to optimise by the total 2D area of the block (width x length) in order to create a "score" and cut each plank to get the maximum score. If I ass the block's area in the algorithm, I could then determine the score and then divide it by the area. All in all, the main focus is in making sure that the highest score matches the highest need so that the machine's goal is the same as ours.
Comments.UserDisplayName: Frank Malenfant
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-31T20:42:56.377Z
Comments.Text: @DukeZhou Sorry if it ain't as clear as it could, English is my second language.
Comments.UserDisplayName: Frank Malenfant
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-31T20:43:52.957Z
Comments.Text: Good info.  You should edit that one line I referenced to make it more clear, and check my edit to make sure I didn't misrepresent any part of your question.
Comments.UserDisplayName: DukeZhou
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-31T20:46:08.343Z
Comments.Text: No worries.  It's a really interesting application and I just want to make sure the question is as clear as possible so that you get the answer you are looking for!
Comments.UserDisplayName: DukeZhou
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-31T20:56:59.293Z
Comments.Text: @DukeZhou Here. I replaced it with the term *multiplicator* and gave some extra information about its usage.
Comments.UserDisplayName: Frank Malenfant
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-31T21:02:32.000Z
Comments.Text: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/64910/discussion-between-dukezhou-and-frank-malenfant).
Comments.UserDisplayName: DukeZhou
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-29T14:07:20.597Z
Comments.Text: This sounds very similar to the optimum cloth cutting problem (you can find an example on the last page here: https://www.andrew.cmu.edu/course/15-211/labs/theory2_sol.pdf). This problem can be solved directly with a deterministic algorithm, so why do you think that you need deep learning or any other learning algorithm for yours?
Comments.UserDisplayName: ginge
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-05T15:28:55.407Z
Comments.Text: This sounds to me like a classical optimization problem. Have you already solved the problem, or do you want to give it a go using optimization modeling? We need to reformulate the problem and need more detailed data, but then it can be formulated as a mixed integer program and solved using optimization software like GAMS/CPLEX.
  BR, Kourosh
Comments.UserDisplayName: Kourosh Marjani Rasmussen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-06T13:18:01.520Z
Comments.Text: Well @ginge, I may be wrong trying to use a learning algorithm for this task, but the reason is that it is not about cut optimizing on my side, another software does it for me. What I need to optimise is a score I give to that software in order to give this machine more or less room for optimisation depending on how quickly I need some parts and how much space I have left to store the parts that are cut earlier.
Comments.UserDisplayName: Frank Malenfant
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-06T13:20:16.857Z
Comments.Text: I feel like I need a learning algorithm because I have many factors to take into account that creates a very large amount of outcomes and I don't see how I could get the the optimal settings without something that detects somme patterns for me and test many variations.
Comments.UserDisplayName: Frank Malenfant
Tags: <deep-learning>
Title: A deep learning algorithm to optimize the outcome
UserDisplayName: Frank Malenfant
ThreadText: # A deep learning algorithm to optimize the outcome
  
  (Asked by: username_0 on 2017-08-31)
  
  I'm am quite new to deep learning but I think I found just the right real-world situation to start using it. The problem is that I have only used such algorithms to predict outcomes. For my new project, I need information to feed a machine with to *optimize* outcomes. Could someone explain briefly how I should proceed? I'm stuck.
  
  **Here's the situation:**
  
  I have a machine that takes planks of wood with different grades of wood available throughout its length and has to cut it into blocks provided in a cut list. This machine will always choose the highest *score* it can get from a given plank. The *score* is obtained by multiplying each block's *area* by its *multiplicator*. The algorithm I want to build has to give that machine a *multiplicator* for each block listed in a cut list. All of the physical output from this machine will be stocked on shelves by a robot until needed. The cutting machine is allowed to downgrade parts of a plank if it helps it reach a higher score.
  
  The value has to act as an incentive for the machine to give me the block I need the most without downgrading too much wood.
  
  ***OPTIMIZATION GOALS***
  
  * Make sure each block is in stock by the time it is needed, but not too early without reason
  * Downgrade as little area of wood as possible (some species are very expensive)
  
  ***INPUT NODES***
  
  * Amount of time before this block is needed
  * Grade of wood for this block
  * Amount of this block needed
  * Block's area (Maybe?)
  
  ***FEEDBACK PROVIDED TO THE ALGORITHM***
  
  * Amount of time in advance that the block was ready (must be as low as possible)
  * Area of wood downgraded \* number of grades skipped
  
  ***EXPECTED RETURN DATA***
  
  * A *multiplicator* that will give that block an optimal its priority relative to others
  
  ***INFORMATION I DON'T HAVE BUT COULD GATHER***
  
  * Mean ratio of each grade for each species of wood
  
  What I've figured out so far is that I may need my feedback to be smashed in only one value in order to make it the output node. The problem is that I can't understand how to make this algorithm to determine a *multiplicator*. Am I wrong in trying to solve this through deep learning?
  
  **Tags:** deep-learning
  > **Comments:**
  > **username_1**: I took the liberty of editing the question for more clarity.  Wasn't sure what to do with: *"Value per cm² that will give that block an optimal its priority relative to others"*  Do you mean giving a block an optimal value in regard to its priority relative to other blocks?  
  > **username_0**: @DukeZhou The machine's algorithm multiplies the value i'm trying to optimise by the total 2D area of the block (width x length) in order to create a "score" and cut each plank to get the maximum score. If I ass the block's area in the algorithm, I could then determine the score and then divide it by the area. All in all, the main focus is in making sure that the highest score matches the highest need so that the machine's goal is the same as ours.  
  > **username_0**: @DukeZhou Sorry if it ain't as clear as it could, English is my second language.  
  > **username_1**: Good info.  You should edit that one line I referenced to make it more clear, and check my edit to make sure I didn't misrepresent any part of your question.  
  > **username_1**: No worries.  It's a really interesting application and I just want to make sure the question is as clear as possible so that you get the answer you are looking for!  
  > **username_0**: @DukeZhou Here. I replaced it with the term *multiplicator* and gave some extra information about its usage.  
  > **username_1**: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/64910/discussion-between-dukezhou-and-frank-malenfant).  
  > **username_2**: This sounds very similar to the optimum cloth cutting problem (you can find an example on the last page here: https://www.andrew.cmu.edu/course/15-211/labs/theory2_sol.pdf). This problem can be solved directly with a deterministic algorithm, so why do you think that you need deep learning or any other learning algorithm for yours?  
  > **username_3**: This sounds to me like a classical optimization problem. Have you already solved the problem, or do you want to give it a go using optimization modeling? We need to reformulate the problem and need more detailed data, but then it can be formulated as a mixed integer program and solved using optimization software like GAMS/CPLEX. BR, Kourosh  
  > **username_0**: Well @ginge, I may be wrong trying to use a learning algorithm for this task, but the reason is that it is not about cut optimizing on my side, another software does it for me. What I need to optimise is a score I give to that software in order to give this machine more or less room for optimisation depending on how quickly I need some parts and how much space I have left to store the parts that are cut earlier.  
  > **username_0**: I feel like I need a learning algorithm because I have many factors to take into account that creates a very large amount of outcomes and I don't see how I could get the the optimal settings without something that detects somme patterns for me and test many variations.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-11-07. Score: 2 | Accepted answer
  
  Deep learning models for regression tasks are quite difficult to train so I would suggest not to start with them. Instead I would start with one of the approaches below and maybe try to use deep learning afterwards.
  
  A classical approach to the problem could be to analyze your optimization software and this would probably lead you to some deterministic algorithm.
  
  Different approaches can be to treat your optimization software as a black box - give it a wide variety of inputs, note down the variables you are interested in (execution time, cutting results, etc.) and try to fit some sort or regressor on it.
  
  One option is to follow Kourosh's idea and formulate it as a classical optimization problem.
  
  If you prefer to use machine learning tools than I'd suggest that you start with a simple model like linear regression just to verify that there is any signal in the data that you can use. Afterwards you can look at more powerful algorithms like xgboost, regression trees, etc.
  
  
  ---
  
  