Re: FYI: AI-programmer

2013-02-25 Thread Robin Becker

On 22/02/2013 19:21, Ian Kelly wrote:
.


Indeed, it seems to me that this is basically Richard Dawkins' weasel
program, with the addition of a transformation step in the fitness
function that amounts to running the string through a Brainfuck
interpreter.  There is a rather large gap between this and getting
computers to generate programs that do anything interesting.

..
this has been done before over and over

eg

http://www.ooblick.com/software/evolve/
http://hampshire.edu/lspector/push.html

I think if the OP could get his brainf*ck algorithm to produce a self printing 
program in brainf*ck that would be quite amusing, but for real advances I 
suggest he makes it generate itself. His fitness is fairly silly since it has no 
idea of fitness except success; minimizing the cpu/memory/program length etc etc 
are all additional measures that could be added/used.

--
Robin Becker

--
http://mail.python.org/mailman/listinfo/python-list


FYI: AI-programmer

2013-02-22 Thread Gisle Vanem

Here is something interesting that you pythonistas might be
interested in:
http://www.primaryobjects.com/CMS/Article149.aspx

This article describes an experiment to produce an AI program, capable of 
   developing its own programs, using a genetic algorithm implementation with 
   self-modifying and self-improving code. 


The above experimental BrainF** language was written using C#. So who will 
be the first to make an AI-language in Python that generates it's own program?


--gv 


--
http://mail.python.org/mailman/listinfo/python-list


Re: FYI: AI-programmer

2013-02-22 Thread Duncan Booth
Gisle Vanem gva...@broadpark.no wrote:

 Here is something interesting that you pythonistas might be
 interested in:
  http://www.primaryobjects.com/CMS/Article149.aspx
 
 This article describes an experiment to produce an AI program,
 capable of 
 developing its own programs, using a genetic algorithm
 implementation with self-modifying and self-improving code. 
 
 The above experimental BrainF** language was written using C#. So who
 will be the first to make an AI-language in Python that generates it's
 own program? 
 

We already have a Python interpreter written in Python that (in most cases) 
runs faster than the original, which is pretty much the same thing. All it 
needs is a bit of AI stuck on to critique the code and complain about the 
weather and you're done.


-- 
Duncan Booth
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: FYI: AI-programmer

2013-02-22 Thread Chris Angelico
On Fri, Feb 22, 2013 at 9:11 PM, Gisle Vanem gva...@broadpark.no wrote:
 Here is something interesting that you pythonistas might be
 interested in:
 http://www.primaryobjects.com/CMS/Article149.aspx

 This article describes an experiment to produce an AI program, capable of
 developing its own programs, using a genetic algorithm implementation with
 self-modifying and self-improving code. 

 The above experimental BrainF** language was written using C#. So who will
 be the first to make an AI-language in Python that generates it's own
 program?

That's not artificial intelligence, though. It's artificial program
generation based on a known target output. The Fitness calculation
is based on a specific target string. This is fine for devising a
program that will produce the entire works of Shakespeare, since there
is a target string for that (actually, several targets, plus you have
to work out whether you want the works of Shakespeare or the works of
some guy named Bacon... mmm bacon), but I suggest that a more
sophisticated and useful goal be implemented.

As suggested in RFC 2795 [1], the resources required to implement such
a project would also have other uses. Like the Infinite Improbability
Drive, this is power that we should put to a very practical use...
such as ending world poverty, curing disease, or most importantly,
writing a good situation comedy for television. [4]

This program generation technique is highly superior to the technique
of taking a number of highly paid programmers, supplying them with
coffee and Internets, and expecting them to produce the code you want.
Empirical evidence has shown repeatedly that highly paid programmers
will produce bugs, and entire programming subindustries exist to
manage these bugs; instead, use of virtualized monkeys running on
innumerable cores of a massively parallel system (note, incidentally,
that RFC 2795 was careful specifically to not preclude implementations
involving subatomic monkeys or multiple universes - I'm sure
virtualization is one of those, but I'm not sure which), with
consequent massive increase of throughput and output.

Please proceed with this implementation, but do keep RFC 2795 in mind.
You want to remain interoperable, which means following the standards.

ChrisA

[1] http://tools.ietf.org/html/rfc2795
[4] The author of RFC 2795 was unable to find a reference in any issue
of TV Guide published between 1956 and the date of that document.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: FYI: AI-programmer

2013-02-22 Thread Gisle Vanem

Chris Angelico ros...@gmail.com wrote:


That's not artificial intelligence, though. It's artificial program
generation based on a known target output. The Fitness calculation
is based on a specific target string. This is fine for devising a
program that will produce the entire works of Shakespeare, since there


You mean, art generation (writing Shakespearian texts) is a process of 
generating known target output?. If we talk about good art (not kitch),
I disagree. For reference, Infinite Monkey Teorem is at 
http://en.wikipedia.org/wiki/Infinite_monkey_theorem


Disregarding the probability math in the above, the question IMHO boils 
down to whether art can be produced by accident (quote from above). 
I seems to recall elephant painting selling for lots of dollars some years ago. 
And long dull poems written by computers. Fooled a lot of people.



As suggested in RFC 2795 [1], the resources required to implement such
a project would also have other uses. Like the Infinite Improbability
Drive,


I did notice that RFC was written on 1 April 2000 :-)

--gv
--
http://mail.python.org/mailman/listinfo/python-list


Re: FYI: AI-programmer

2013-02-22 Thread Neil Cerutti
On 2013-02-22, Gisle Vanem gva...@broadpark.no wrote:
 Disregarding the probability math in the above, the question
 IMHO boils down to whether art can be produced by accident
 (quote from above). I seems to recall elephant painting selling
 for lots of dollars some years ago. And long dull poems written
 by computers. Fooled a lot of people.

The painting elephants are trained to paint basically the same
painting over and over. There's not much chance involved.

-- 
Neil Cerutti
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: FYI: AI-programmer

2013-02-22 Thread Ian Kelly
On Fri, Feb 22, 2013 at 4:41 AM, Chris Angelico ros...@gmail.com wrote:
 That's not artificial intelligence, though. It's artificial program
 generation based on a known target output. The Fitness calculation
 is based on a specific target string. This is fine for devising a
 program that will produce the entire works of Shakespeare, since there
 is a target string for that (actually, several targets, plus you have
 to work out whether you want the works of Shakespeare or the works of
 some guy named Bacon... mmm bacon), but I suggest that a more
 sophisticated and useful goal be implemented.

Indeed, it seems to me that this is basically Richard Dawkins' weasel
program, with the addition of a transformation step in the fitness
function that amounts to running the string through a Brainfuck
interpreter.  There is a rather large gap between this and getting
computers to generate programs that do anything interesting.

I am curious about how he deals with infinite loops in the generated
programs.  Probably he just kills the threads after they pass some
time threshold?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: FYI: AI-programmer

2013-02-22 Thread Andrew Robinson

On 02/22/2013 07:21 PM, Ian Kelly wrote:

On Fri, Feb 22, 2013 at 4:41 AM, Chris Angelico ros...@gmail.com wrote:

That's not artificial intelligence, though. It's artificial program
generation based on a known target output. The Fitness calculation
is based on a specific target string. This is fine for devising a
program that will produce the entire works of Shakespeare, since there
is a target string for that (actually, several targets, plus you have
to work out whether you want the works of Shakespeare or the works of
some guy named Bacon... mmm bacon), but I suggest that a more
sophisticated and useful goal be implemented.

Indeed, it seems to me that this is basically Richard Dawkins' weasel
program, with the addition of a transformation step in the fitness
function that amounts to running the string through a Brainfuck
interpreter.  There is a rather large gap between this and getting
computers to generate programs that do anything interesting.

I am curious about how he deals with infinite loops in the generated
programs.  Probably he just kills the threads after they pass some
time threshold?
I'm under the impression that Python doesn't really allow you to kill a 
thread after a time period.

It's not portable to do so

http://eli.thegreenplace.net/2011/08/22/how-not-to-set-a-timeout-on-a-computation-in-python/

--
http://mail.python.org/mailman/listinfo/python-list


Re: FYI: AI-programmer

2013-02-22 Thread Ian Kelly
On Fri, Feb 22, 2013 at 5:09 AM, Andrew Robinson
andr...@r3dsolutions.com wrote:
 On 02/22/2013 07:21 PM, Ian Kelly wrote:
 I am curious about how he deals with infinite loops in the generated
 programs.  Probably he just kills the threads after they pass some
 time threshold?

 I'm under the impression that Python doesn't really allow you to kill a
 thread after a time period.
 It's not portable to do so

He's using C#, not Python.  And anyway, you can cooperatively request
threads to shut down; just have the Brainfuck interpreter thread check
for a shutdown request every N cycles, or even just place the timeout
in the interpreter thread itself.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: FYI: AI-programmer

2013-02-22 Thread Andrew Robinson

On 02/22/2013 08:23 PM, Ian Kelly wrote:

On Fri, Feb 22, 2013 at 5:09 AM, Andrew Robinson
andr...@r3dsolutions.com wrote:

On 02/22/2013 07:21 PM, Ian Kelly wrote:

I am curious about how he deals with infinite loops in the generated
programs.  Probably he just kills the threads after they pass some
time threshold?

I'm under the impression that Python doesn't really allow you to kill a
thread after a time period.
It's not portable to do so

He's using C#, not Python.  And anyway, you can cooperatively request
threads to shut down; just have the Brainfuck interpreter thread check
for a shutdown request every N cycles, or even just place the timeout
in the interpreter thread itself.

-
1st)
It's still surprising that even C# would allow a killing of threads.

Resources can be allocated by a thread and tied up was one of the 
comments made on the site I linked; so those resources could be 
permanently tied up until process exit if the thread is killed.


eg: killing a thread is different from killing the process it is running in.

I'm not familiar enough with C# to know if it does garbage collection or 
not, or how de-allocation is handled; so perhaps I missed something.


--
2nd)

How would you get an interpreter thread to check for a shutdown request 
every N cycles?
I've read about how to set a timeout based on time, but not on any kind 
of cycle (eg: instruction cycle?) count.


Do you have a python example?
Thanks!


--
http://mail.python.org/mailman/listinfo/python-list


Re: FYI: AI-programmer

2013-02-22 Thread Ian Kelly
On Fri, Feb 22, 2013 at 6:04 AM, Andrew Robinson
andr...@r3dsolutions.com wrote:
 It's still surprising that even C# would allow a killing of threads.

 Resources can be allocated by a thread and tied up was one of the comments
 made on the site I linked; so those resources could be permanently tied up
 until process exit if the thread is killed.

 eg: killing a thread is different from killing the process it is running in.

 I'm not familiar enough with C# to know if it does garbage collection or
 not, or how de-allocation is handled; so perhaps I missed something.

I have no idea where C# stands on forced thread termination.  I only
pointed out that it was C# because you specifically referred to
Python.

 How would you get an interpreter thread to check for a shutdown request
 every N cycles?
 I've read about how to set a timeout based on time, but not on any kind of
 cycle (eg: instruction cycle?) count.

A cycle here would be the execution of one Brainfuck instruction.
The control loop would look something like this:

while True:
if shutdown_event.is_set():
break
for i in range(N):
interpreter.cycle()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: FYI: AI-programmer

2013-02-22 Thread Oscar Benjamin
On 22 February 2013 13:04, Andrew Robinson andr...@r3dsolutions.com wrote:

 How would you get an interpreter thread to check for a shutdown request
 every N cycles?
 I've read about how to set a timeout based on time, but not on any kind of
 cycle (eg: instruction cycle?) count.

 Do you have a python example?

while True:
for n in range(N):
if process_cycle() == END:
return
if shutdown():
raise ShutDownError


Oscar
-- 
http://mail.python.org/mailman/listinfo/python-list