News for hackers. Stuff that matters.
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 woah on Thursday July 14, 2016 @11:20AM (#12094592)
Read the article, these type of algorithms have an easy time with syntax. The real issue is that the code produced is meaningless.
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 iandanforth on Thursday July 14, 2016 @12:28PM (#12095200)
What about a statically analyzable language? That could be factored into the loss function.
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 kordless on Thursday July 14, 2016 @11:40AM (#12094756)
> The real issue is that the code produced is meaningless.

Sounds like something I'd code up.

Re:Teaching an AI to write Python code with Python code by jasikpark on Thursday July 14, 2016 @11:14AM (#12094528)
So... some form of lisp would probably be best, right? Or maybe just binary or assembly?