Training a Neural Net to Generate CSS
gwern.net
gwern.net
That might be a parse error according to validator, but it's actually a pretty commonly used hack for old Internet Explorers - real browsers drop such invalid declaration, while IE (up to 6 I think, although 7 still accepted some other character IIRC) parsed it anyway and ignored the asterisk. What's more - this quirk is commonly used with, guess what, the "zoom" property, which is one of the common ways to trigger "hasLayout" mode in IE engine (although you'd most likely use it with value "1" instead of "2").
So this NN simply wrote a compatibility hack for IE6 :)
Note: I am obviously not gwern.
* Evolutionary Computation for Music, Art, and Creativity - http://cilab.cs.ccu.edu.tw/ci-tf/ECMAC2015.html
* EvoMUSART - http://www.evostar.org/2016/cfp_evomusart.php
* International Symposium on Computational Aesthetics in Graphics, Visualization, and Imaging - http://expressive.richardt.name/2015/CAe/Home
* Generative Art Conference - http://www.generativeart.com/
I've seen a few papers working on CSS in the past.
Is it possible to nudge the RNN in a particular direction - so that it produces something that we want ? Perhaps there is an answer to this in Alex Graves et al. Paper on Handwriting generation. A more thorough explanation or exploration in this direction would perhaps help ?.
Anyone really working on generating CSS ( conditioned! ) ?
Then I imagine you could do interesting stuff by e.g. constraining the HTML and seeing what kind of CSS was spit out.
genetic css?
(Actually, there's a surprising dearth of reinforcement learning in general. Very few blog posts or demos or introductory materials. It makes it hard to understand what is new about DQN or how the whole system works on a concrete coding level.)
sum( abs(X_expected - X_actual) *
abs(Width_expected - Width_actual) +
abs(Y_expected - Y_actual) *
abs(Height_expected - Height_actual) )
mapped over all elements ought to do the trick. When you hit 0, it's a perfect reproduction.I thought about trying to do MCMC over a beam search through the rnn output, but ran out of time and patience.
The best paper award at CVPR this year (http://www.cv-foundation.org/openaccess/content_cvpr_2015/ht...) has an architecture somewhat like this: instead of a web browser they're using a 3D rendering engine, and searching for pose parameters that cause their rendered image to match an observed image. This is just Bayesian inference using MCMC, where they train a deep net to function as a data-driven proposal distribution.
If your goal were to actually get a working system, you'd probably want to do inference directly on a parameter vector encoding all the relevant quantities - heights, widths, font sizes, colors, etc. of the various boxes, etc. - that you could programmatically ground out into a CSS file. Trying to do inference over the raw text is making things artificially hard since you have to put so much work into even just getting correct syntax. Though maybe that's part of the fun. :-)
This would create a simple way of generating CSS styles for a document, without dealing with the complicated issues of RNNs having limited memory and producing correct syntax.
Then you can use these predictions as a prior probability over what the CSS styles should be. Then you can use some kind of bayesian optimization to find the optimal settings in the least number of experiments.
After some busy work along that line, we would arrive at a generation of PLs where you don't write source code but have it generated from interpreted speech input.
I'm not so sure I (as a programmer) would really want that, but it would seem a rather obvious line of development.
Has anyone trained RNN on YCombinator comments ?
If there were any bot reading comments, it already know your idea ;)