Re:Teaching an AI to write Python code with Python code
by RodgerTheGreat on Thursday July 14, 2016 @09:58AM
(#12093788)
Python's context-sensitive grammar makes it a particularly unsuitable target for text-based generation of code in this manner. If you continue with this project I expect you will find you get far better results from generating ASTs or choosing a language with a simple grammar in which most possible compositions of tokens are valid.
Re:Teaching an AI to write Python code with Python code
by dasboth on Thursday July 14, 2016 @11:49AM
(#12094826)
Exactly, the difficulty is not really in producing valid code but meaningful code. Same with text generation - while a recurrent neural network might produce grammatically correct sentences, I don't think we're close to it producing an story with an actual plot, discernible characters etc.
Re:Teaching an AI to write Python code with Python code
by king_phil on Thursday July 14, 2016 @04:16PM
(#12096861)
I was thinking the same. Not only that, if you would add multiple networks that, for example, weigh the possibility that a full line is "good" code, and another that evaluates a whole block (like google deep mind did with AlphaGo) so it looks like dense and complex code this could be a nice program trolling with pull requests on github :-D
Re:Teaching an AI to write Python code with Python code
by transcranial on Thursday July 14, 2016 @12:37PM
(#12095295)
Yeah, there's no effort to direct or encode intent. It's just producing what it probabilistically wants to produce. If it happens to run...cool?
Here's a interesting example from Google DeepMind learning to generate code for Magic The Gathering and Hearthstone: http://arxiv.org/pdf/1603.06744v2.pdf
Re:Teaching an AI to write Python code with Python code
by ElHacker on Thursday July 14, 2016 @11:48AM
(#12094818)
This is a cool project. I did something similar with LSTM in Tensorflow to generate Reddit comments. The biggest problem I found in my experiment is that the comments generated had not real meaning, nor even tried to deliver a message. Real Reddit users identified this right away, resulting in my Bot being banned. I think the author faced the same issues here.
Does anyone has any suggestions on papers that try to solve that problem?
Re:Teaching an AI to write Python code with Python code
by transcranial on Thursday July 14, 2016 @12:45PM
(#12095348)
The problem is that the latent space of a model trained on all comments is still massive. For any sort of coherence, you need to condition the probabilities on smaller spaces, or enforce structural bounds.
Here's an example of a paper where they simultaneously optimize high-level semantics with token-level sequence probabilities: http://arxiv.org/pdf/1606.00776v2.pdf.
Re:Teaching an AI to write Python code with Python code
by aangjie on Thursday July 14, 2016 @12:04PM
(#12094969)
It'd be interesting to make sure the minimum data (code) sent to the neural network is all meaningful or purely functional. Perhaps as somebody pointed out taking ast and then figuring out stateless chunks might be a good idea?? I'll take a shot..
Re:Teaching an AI to write Python code with Python code
by ankurdhama on Thursday July 14, 2016 @11:59PM
(#12098863)
Much like I can learn to speak Chinese by listening lots of sound tracks of people speaking Chinese and over time building a probabilistic model of what sound will come next.
Re:Teaching an AI to write Python code with Python code
by bbctol on Thursday July 14, 2016 @12:25PM
(#12095171)
This is cute, but the title got me excited for something well beyond this. Heck, even if an AI produced spontaneously code that defined a function and later used it, I'd be ecstatic. This is just a fun piece of art.
Sounds like something I'd code up.
Here's a interesting example from Google DeepMind learning to generate code for Magic The Gathering and Hearthstone: http://arxiv.org/pdf/1603.06744v2.pdf
Does anyone has any suggestions on papers that try to solve that problem?
Here's an example of a paper where they simultaneously optimize high-level semantics with token-level sequence probabilities: http://arxiv.org/pdf/1606.00776v2.pdf.