Wednesday, April 8, 2015

No bullshit approach to training deep conceptual networks with pierogis.

Disclaimer: This is a draft version of the publication. Grammatical and errors of high dumbness values are expected. Any suggestions welcome. 


It has been known for a very long time that polish pierogi are the best.
Many researchers have attempted to improve the quality and taste,
never the less we prove in this publication, that true polish style
pierogi are undeniably superior.


Polish style approach to making pierogi can be decomposed into Implementation, Compilation, Execution and Results Gathering phase. The following sections describe all of the phases. Total execution time of the algorithm is about 4-6 hours, so it is advised to preprocess the ingredients and store in cache and then dynamically load the results just-in-time.

Related Work

The were many attempts to make pierogi. Especially popular approach in USA is making pierogi with potato and cheese. They are all inferior. 

Problem definition

We want to achieve results from fig. 1 while maximizing the taste and overall experience.
Figure 1: Target result.

Approach: Implementation

First we need to implement various ingredients:

For the filling:
maggi (fig. 2)
0,5 kg beacon
2 cabbages
1 handfull of dried mashrooms
2 eggs
2 onions

For the dough:
1 kg flour (+ 50 % reserve)
1 glass hot water
1 teaspoon salt
3 teaspoons vegetable oil

Final touch:
0,5 kg bacon
Figure 2: Maggi - can be found in many Asian markets in USA, it's quite common in Europe.

Approach: Compilation (filling)

Next we need to compile ingredients.

First and foremost cabbage must be cut in 2^2 (recommended) or 2^3 pieces and boiled for about 30 to 60 minutes depending on environment and compiler version.

Figure 3: cabbage being boiled
Then cabbage must be sequeezed out until it has almost no water (pro tip: trap it in a cloth and rotate progressively reducing trap's volume). Compile the cabbage and cut into very mini batches.

Mushrooms should be soaked in water the day before. Also cut in very mini batches.

Finally project bacon onto 3D grid (cubes of side 5mm):

Figure 4: 3D grid projection of bacon and onions.
Union the onion and bacon projection in Pan and apply simulated annealing until crispy. Mix with Cabbage and mashrooms.

Finally apply grid search over values of salt, pepper and maggi. Apply bias correction to maggi, because the taste will become less intense after execution (do overshoot!).

If and only if the grid search has finished, add 2 eggs (grid search will be disabled after that procedure since raw eggs pose a security threat to our system).

Final effect should look somewhat like fig. 5.

Figure 5: compiled filling

Approach: Compilation (dough)

For the dough compilation we will need a lot of clean memory on our table. First we save 1kg of flour on our table and form a heap, with special area of memory reserved in the middle. We put two egg yolks in the middle together with teaspoon of salt and and 3 tablespoons of oil. Snapshot of memory layout at this stage is presented on fig. 6.

Figure 6: Compiled heap data structure.
 Now we come to the hardest step of compilation - optimization. Everybody knows that compiler optimization is the toughest part. We need to optimized the dough until it has the right fully-elastic and strictly-convex form like on fig. 7.

Figure 7: Optimized intermediate representation of the dough.

Approach: Compilation (final stage)

In this stage we compile intermediate representations of the dough and filling to platform dependant pot-friendly form. 

First we need to project the though onto a plane like (fig. 8).

Figure 8: dough partially projected onto a plane.
Then we apply variance-bounded gaussian clustering onto the projected dough and then we map the subsets of filling onto corresponding clusters. 

Figure 10: subset of a filling mapped onto a cluster
Figure 9: clustering of the though

Finally we apply Foldows-Forker transform to compress the clusters into pot-friendly form.

Figure 11: Preparing final executable form of pierogi.

Approach: Execution

We take compiled pierogi and we execute them in boiling water. After the pierogi emerge on the surface on the water, we exponentially backoff for approximately four minutes (assuming the dough was projected onto thin enough plane), potentially more. 

Approach: Results collection

Resulting data should be collected on a plate and annotated with fried 3D grid projected bacon. Final version stored to desk/table should like like on fig.1


We have managed to implement the real world version of pierogi. Our results are summarized in table below.

Attempt Results
Walmarts Pierogi Terrible
Random polish guy's pierogi Poor data quality
Minced-meat pierogi Disgusting
Our pierogi Vastly superior
Table 1: Comparison of various pierogi making approaches.


Polish pierogi are the best.

Appendix A: Failure modes

Failure mode A (timeout errors):
In order to ensure results are collected before time X, the pierogis should be precompiled and executed at time X - 30 minutes

Failure mode B (undercooked pierogi):
Apply better projection algorithm when compiling though. Alternatively increase exponential backoff during execution.

Failure mode C (neutral taste):
Add more maggi!