Monday, September 30, 2013

Genetic Soylent

I've been playing around with nickp's genetic soylent code. The results have been fascinating, and anyone interested can play with my modifications to the code here. (And view the code itself on my github repository here.)

To show the kind of optimization that one can obtain, compare the nutrients in the original hacker school recipe with the genetically optimized one that I've posted on diy.soylent.me. Looking at the completeness graphs, we've gone from 86% complete on the original recipe to 94% complete for the optimized recipe--all using the same ingredients. Of course, an optimized recipe does not necessarily mean a tasty recipe and, looking at all the brown sugar from the best result I found, it certainly doesn't mean a low glycemic index.

My findings so far:

  • Running the genetic algorithm multiple times is a good idea. It will sometimes find a local minima that it can't climb out of. Running a few times will help you see a larger picture.
  • Apparently milk and brown sugar are a good way to get a lot of nutrients.
  • Watching the deviation counter drop as the recipe continues is a lot of fun.
  • Usually a recipe has "settled" after somewhere between 300 and 500 generations.
  • Imposing more constraints can be helpful for getting a recipe to settle more quickly. Additionally, adding a minimum of certain ingredients (like cocoa power or sugar) can help ensure that the result will taste good.

Words of warning:
  • Min/Max on the ingredients still have some bugs. The recipe won't always respect the minimum value for an ingredient.
  • Not all recipes from diy.soylent.com work yet, so there are still some issues to be tracked down.
  • As with all soylent recipes, you should really know what you are doing before you start consuming one regularly.

No comments:

Post a Comment