From ashokcm at gmail.com Wed Oct 3 06:05:42 2007 From: ashokcm at gmail.com (Ashok CM) Date: Wed Oct 3 06:05:44 2007 Subject: [Pyro-users] Introduction & Khepera robot for gazebo Message-ID: <1e3ed5ad0710030305k61910564s8cb1dd0b330ae5c@mail.gmail.com> Hi All, First of all I am a new addition to this mailing list. Please find below an introduction. I was wondering if any of you know where I can find the code for the Khepera robot for simulation in Gazebo. Unfortunately Gazebo does not come with it. I have already started writing it, but it would be great if I can reuse. I would also like to know if any of you have tried connecting to a Khepera running on Gazebo from pyro. Any help would be greatly appreciated. thanks & regards Ashok Mohan ########################################################################## I am Ashok Mohan and I work as a research assistant for XPERO ( http://www.xpero.org) project. The objective of the project is to develop an embodied cognitive system, which is able to conduct experiments in the real world with the purpose of gaining new insights about the world and the objects therein and to develop and improve its own cognitive skills and overall performance. It is a European framework project. I am also a final semester MS student (Robotics) at University of Applied Sciences, Bonn-Rhein-Sieg. My master thesis deals with automated qualitative model creation based on observations from a robot. I am currently using Gazebo as a simulator for simulating my environment. This eases a lot of my work as I dont have to worry about setting up and running the actual robot. I recently came about pyro and thought it is a very intuitive approach. I have already tried using pyro to connect to gazebo so that I need to worry only about writing "brains" and not low level robot commads. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20071003/47176e00/attachment.htm From jacodwa at gmail.com Thu Oct 18 11:26:55 2007 From: jacodwa at gmail.com (=?ISO-8859-1?Q?Jacobo_Tarrag=F3n?=) Date: Thu Oct 18 11:27:00 2007 Subject: [Pyro-users] Tkinter error "Thread.__init__() not called" on pyro 4.9.3 under Mac OS X Tiger Message-ID: <7040539c0710180826w468d4d96yfa3b2734d461b96a@mail.gmail.com> Hi there! I'm pretty new to pyrobot, but after a hard installation process I got it running. My Server, Robot (PyrobotSimulator/Vaccum cleaner, PyrobotRobot6000) and Brain are loading correctly, but I get the following Tkinter error when trying to run (or step) the simulation: *********************************************** Exception in Tkinter callbak Traceback (most recent call last): File "/Library/Frameworks/Python.framwork/Versions/2.4//lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__ return self.func(*args) File "./gui/__init__.py", line 443, in stepEngine self.engine.pleaseStep() File "./engine/__init__.py", line 257, in pleaseStep self.brain.pleaseStep() File "./brain/__init__.py", line 180, in pleaseStep while self.isAlive() and self.condition.acquire(0) == 0: File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/threading.py", line 567, in isAlive assert self.__initialized, "Thread.__init() not called" AssertionError: Thread.__init__() not called *********************************************** I've been looking through the archives, but couldn't find a solution... is there a known fix for this? Have I missed something? Any help will be so much thankful : ) See you! *********************************************** My system config is: Mac OS X 10.4.10 Python2.4, Python2.5 (2.5 is default, but I get the same error no matter which python I run) Pyrobot compiled with Python2.4 All features turned off while configuring Native Tk is working correctly (I run the test ok on the python console) Imagelib, numpy are also installed for python. I run pyrobot this way: jacobo@marvin: ~/pyrobot/ $ python bin/pyrobot - or - jacobo@marvin ~/pyrobot/ $ /Library/Frameworks/Python.framework/Versions/2.4/bin/python2.4 bin/pyrobot From dblank at brynmawr.edu Thu Oct 18 12:14:45 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Thu Oct 18 12:14:57 2007 Subject: [Pyro-users] Tkinter error "Thread.__init__() not called" on pyro 4.9.3 under Mac OS X Tiger In-Reply-To: <7040539c0710180826w468d4d96yfa3b2734d461b96a@mail.gmail.com> References: <7040539c0710180826w468d4d96yfa3b2734d461b96a@mail.gmail.com> Message-ID: <47178675.10108@brynmawr.edu> Does this command work (all one line): python bin/pyrobot -s PyrobotSimulator -w VacuumCleanerWorld.py -r PyrobotRobot60000 -b Test I just ran with Pyrobot version 5.0.0 and it worked, but I can't think of anything that would not work on 4.9.3 Mac (but I haven't tried it). Anyone else running on Mac that could test this? You can get the current CVS version here: http://pyrorobotics.org/?page=PyroDeveloperCVS -Doug Jacobo Tarrag?n wrote: > Hi there! > > I'm pretty new to pyrobot, but after a hard installation process I got > it running. My Server, Robot (PyrobotSimulator/Vaccum cleaner, > PyrobotRobot6000) and Brain are loading correctly, but I get the > following Tkinter error when trying to run (or step) the simulation: > > *********************************************** > Exception in Tkinter callbak > Traceback (most recent call last): > > File "/Library/Frameworks/Python.framwork/Versions/2.4//lib/python2.4/lib-tk/Tkinter.py", > line 1345, in __call__ > > return self.func(*args) > > File "./gui/__init__.py", line 443, in stepEngine > > self.engine.pleaseStep() > > File "./engine/__init__.py", line 257, in pleaseStep > > self.brain.pleaseStep() > > File "./brain/__init__.py", line 180, in pleaseStep > > while self.isAlive() and self.condition.acquire(0) == 0: > > File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/threading.py", > line 567, in isAlive > > assert self.__initialized, "Thread.__init() not called" > AssertionError: Thread.__init__() not called > *********************************************** > > I've been looking through the archives, but couldn't find a > solution... is there a known fix for this? Have I missed something? > > Any help will be so much thankful : ) > > See you! > > *********************************************** > > My system config is: > > Mac OS X 10.4.10 > Python2.4, Python2.5 (2.5 is default, but I get the same error no > matter which python I run) > Pyrobot compiled with Python2.4 > All features turned off while configuring > Native Tk is working correctly (I run the test ok on the python console) > Imagelib, numpy are also installed for python. > > I run pyrobot this way: > > jacobo@marvin: ~/pyrobot/ $ python bin/pyrobot > - or - > jacobo@marvin ~/pyrobot/ $ > /Library/Frameworks/Python.framework/Versions/2.4/bin/python2.4 > bin/pyrobot From swaffoj at allegheny.edu Tue Oct 23 13:47:59 2007 From: swaffoj at allegheny.edu (John Mark Swafford) Date: Tue Oct 23 13:48:17 2007 Subject: [Pyro-users] Testing Robot Simulation on a Mac Message-ID: <471E33CF.5030507@allegheny.edu> Hello All, I am using grammatical evolution (similar to genetic algorithms) to develop pyrobot code. I can not figure out how to run the generated pyrobot code without the GUI and still get the returned output from the pyrobot code. Is there a way to run my pyrobot code from another python program, but not call the GUI? I'm running OS X 10.4.9 if that makes any difference. Thanks, John Mark Swafford Allegheny College swaffoj@allegheny.edu From dblank at brynmawr.edu Tue Oct 23 14:06:54 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Tue Oct 23 14:07:08 2007 Subject: [Pyro-users] Testing Robot Simulation on a Mac In-Reply-To: <471E33CF.5030507@allegheny.edu> References: <471E33CF.5030507@allegheny.edu> Message-ID: <471E383E.8010403@brynmawr.edu> John Mark Swafford wrote: > Hello All, > > I am using grammatical evolution (similar to genetic algorithms) to > develop pyrobot code. I can not figure out how to run the generated > pyrobot code without the GUI and still get the returned output from the > pyrobot code. Is there a way to run my pyrobot code from another python > program, but not call the GUI? I'm running OS X 10.4.9 if that makes any > difference. John Mark, Try checking out: http://pyrorobotics.org/?page=PyroFromPython and see if that gives you some hints. -Doug > > > Thanks, > John Mark Swafford > Allegheny College > swaffoj@allegheny.edu From dieter_vanderelst at emailengine.org Thu Oct 25 11:18:21 2007 From: dieter_vanderelst at emailengine.org (Dieter Vanderelst) Date: Thu Oct 25 11:18:23 2007 Subject: [Pyro-users] Using the SRN Message-ID: <4720B3BD.9060709@emailengine.org> Hi, I need some advise on the use off SRN (simple recurrent nets). I know what the network does but I need some help on the Pyro implementation. This is what I want to do with the net: -I want to train a SRN using a single (very long) sequence of patterns. The examples I could find on SRN all define a number of patterns and build a sequence of these on the fly. However, I will read a single long sequence of patterns from a file (experimental data). -Second, I want to analyze the activation of the hidden nodes in response to each different input pattern. To this, I want present the net ad random with a long sequence of input patterns and register the activations. -I don't want the network to be trained using batch updating. Given my problem, batch updating is senseless. So, could somebody assist me in finding the best settings for this kind of requirements? Thanks, Dieter Vanderelst From dblank at brynmawr.edu Thu Oct 25 14:16:31 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Thu Oct 25 14:16:48 2007 Subject: [Pyro-users] Using the SRN In-Reply-To: <4720B3BD.9060709@emailengine.org> References: <4720B3BD.9060709@emailengine.org> Message-ID: <4720DD7F.7070304@brynmawr.edu> Dieter, You can use as long of sequences as you want, even from a file. See, for example, the section on off-line learning here: http://pyrorobotics.org/?page=Building_20Neural_20Networks_20using_20Conx or http://pyrorobotics.org/?page=Robot_20Learning_20using_20Neural_20Networks You can use the loadDataFromFile or loadInputsFromFile / loadtargetsFromFile. If you want to look at hidden layer activations, perhaps the easiest method would be to use the SRN.propagate(input=[0,1,0,0,1]) form, and then look at the hidden layer. For example: srn = SRN() # .. add layers, train srn.propagate(input=[0,1,0,0,1]) print srn["hidden"].activation Another way would be to extend the SRN class and override one of the methods, like postBackprop: from pyrobot.brain.conx import * class MySRN(SRN): def postBackprop(self, **args): print self["hidden"].activation SRN.postBackprop(self, **args) and use the MySRN class exactly the way that you would the SRN class. That would allow you to examine the hidden layer during processing. You can set batch to 0 and you shouldn't have any problem, either way. Hope that helps, -Doug Dieter Vanderelst wrote: > Hi, > > I need some advise on the use off SRN (simple recurrent nets). > > I know what the network does but I need some help on the Pyro > implementation. > This is what I want to do with the net: > -I want to train a SRN using a single (very long) sequence of patterns. > The examples I could find on SRN all define a number of patterns and > build a sequence of these on the fly. However, I will read a single long > sequence of patterns from a file (experimental data). > > -Second, I want to analyze the activation of the hidden nodes in > response to each different input pattern. To this, I want present the > net ad random with a long sequence of input patterns and register the > activations. > > -I don't want the network to be trained using batch updating. Given my > problem, batch updating is senseless. > > So, could somebody assist me in finding the best settings for this kind > of requirements? > > Thanks, > Dieter Vanderelst > > _______________________________________________ > Pyro-users mailing list > Pyro-users@pyrorobotics.org > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > From dieter_vanderelst at emailengine.org Fri Oct 26 06:26:30 2007 From: dieter_vanderelst at emailengine.org (Dieter Vanderelst) Date: Fri Oct 26 06:26:32 2007 Subject: [Pyro-users] Using the SRN In-Reply-To: <4720DD7F.7070304@brynmawr.edu> References: <4720B3BD.9060709@emailengine.org> <4720DD7F.7070304@brynmawr.edu> Message-ID: <4721C0D6.2040804@emailengine.org> Dear Douglas, Thank you for your answer. I have programmed a net based on your pointers. But I still have some troubles. This is what I do: I use the code at http://pyrorobotics.org/?page=SRNModuleExperiments to make an elman net. Then I want to train this net by setting *single* input and output pattern repetitively: for each input_vector en output_vector: network.setInputs([input_vector]) network.setOutputs([output_vector]) network.train() #train the network some *more* on each pass Is this possible? It seems like the net is resetting itself after each call of train since it considers each pass trough this loop a an epoch? Can this resetting be switched off? Regards, Dieter Douglas S. Blank wrote: > Dieter, > > You can use as long of sequences as you want, even from a file. > > See, for example, the section on off-line learning here: > http://pyrorobotics.org/?page=Building_20Neural_20Networks_20using_20Conx > or > http://pyrorobotics.org/?page=Robot_20Learning_20using_20Neural_20Networks > > You can use the loadDataFromFile or loadInputsFromFile / > loadtargetsFromFile. > > If you want to look at hidden layer activations, perhaps the easiest > method would be to use the SRN.propagate(input=[0,1,0,0,1]) form, and > then look at the hidden layer. For example: > > srn = SRN() > # .. add layers, train > srn.propagate(input=[0,1,0,0,1]) > print srn["hidden"].activation > > Another way would be to extend the SRN class and override one of the > methods, like postBackprop: > > from pyrobot.brain.conx import * > class MySRN(SRN): > def postBackprop(self, **args): > print self["hidden"].activation > SRN.postBackprop(self, **args) > > and use the MySRN class exactly the way that you would the SRN class. > That would allow you to examine the hidden layer during processing. > > You can set batch to 0 and you shouldn't have any problem, either way. > > Hope that helps, > > -Doug > > Dieter Vanderelst wrote: >> Hi, >> >> I need some advise on the use off SRN (simple recurrent nets). >> >> I know what the network does but I need some help on the Pyro >> implementation. >> This is what I want to do with the net: >> -I want to train a SRN using a single (very long) sequence of >> patterns. The examples I could find on SRN all define a number of >> patterns and build a sequence of these on the fly. However, I will >> read a single long sequence of patterns from a file (experimental data). >> >> -Second, I want to analyze the activation of the hidden nodes in >> response to each different input pattern. To this, I want present the >> net ad random with a long sequence of input patterns and register the >> activations. >> >> -I don't want the network to be trained using batch updating. Given my >> problem, batch updating is senseless. >> >> So, could somebody assist me in finding the best settings for this >> kind of requirements? >> >> Thanks, >> Dieter Vanderelst >> >> _______________________________________________ >> Pyro-users mailing list >> Pyro-users@pyrorobotics.org >> http://emergent.brynmawr.edu/mailman/listinfo/pyro-users >> > From dblank at brynmawr.edu Fri Oct 26 06:42:26 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Fri Oct 26 06:42:27 2007 Subject: [Pyro-users] Using the SRN In-Reply-To: <4721C0D6.2040804@emailengine.org> References: <4720B3BD.9060709@emailengine.org> <4720DD7F.7070304@brynmawr.edu> <4721C0D6.2040804@emailengine.org> Message-ID: <2967.71.59.123.159.1193395346.squirrel@webmail.brynmawr.edu> On Fri, October 26, 2007 6:26 am, Dieter Vanderelst said: > Dear Douglas, > > Thank you for your answer. > > I have programmed a net based on your pointers. But I still have some > troubles. > > This is what I do: > > I use the code at http://pyrorobotics.org/?page=SRNModuleExperiments to > make an elman net. > > Then I want to train this net by setting *single* input and output pattern > repetitively: > > for each input_vector en output_vector: > network.setInputs([input_vector]) > network.setOutputs([output_vector]) > network.train() #train the network some *more* on each pass > > > Is this possible? It seems like the net is resetting itself after each > call of train since it considers each pass trough this loop a an epoch? > Can this resetting be switched off? Dieter, Sounds like you are experiencing "catastrophic forgetting". You training the network each input/target pair until in learns completely. Then you no longer train on that pair, and the network forgets the previous patterns. (See the "cross correlation" tools to track this in conx). I see at least three easy things you could do: 1) train all patterns at once in a corpus 2) add to the corpus each time, so you don't forget previous patterns (we actually have a model that does that automatically called a "network governor") 3) only train each pair for N epochs, rather than to a fully trained state. There are also many papers on the topic which involve all sorts of variations. -Doug > > > Regards, > Dieter > > > > Douglas S. Blank wrote: >> Dieter, >> >> You can use as long of sequences as you want, even from a file. >> >> See, for example, the section on off-line learning here: >> http://pyrorobotics.org/?page=Building_20Neural_20Networks_20using_20Conx >> or >> http://pyrorobotics.org/?page=Robot_20Learning_20using_20Neural_20Networks >> >> You can use the loadDataFromFile or loadInputsFromFile / >> loadtargetsFromFile. >> >> If you want to look at hidden layer activations, perhaps the easiest >> method would be to use the SRN.propagate(input=[0,1,0,0,1]) form, and >> then look at the hidden layer. For example: >> >> srn = SRN() >> # .. add layers, train >> srn.propagate(input=[0,1,0,0,1]) >> print srn["hidden"].activation >> >> Another way would be to extend the SRN class and override one of the >> methods, like postBackprop: >> >> from pyrobot.brain.conx import * >> class MySRN(SRN): >> def postBackprop(self, **args): >> print self["hidden"].activation >> SRN.postBackprop(self, **args) >> >> and use the MySRN class exactly the way that you would the SRN class. >> That would allow you to examine the hidden layer during processing. >> >> You can set batch to 0 and you shouldn't have any problem, either way. >> >> Hope that helps, >> >> -Doug >> >> Dieter Vanderelst wrote: >>> Hi, >>> >>> I need some advise on the use off SRN (simple recurrent nets). >>> >>> I know what the network does but I need some help on the Pyro >>> implementation. >>> This is what I want to do with the net: >>> -I want to train a SRN using a single (very long) sequence of >>> patterns. The examples I could find on SRN all define a number of >>> patterns and build a sequence of these on the fly. However, I will >>> read a single long sequence of patterns from a file (experimental >>> data). >>> >>> -Second, I want to analyze the activation of the hidden nodes in >>> response to each different input pattern. To this, I want present the >>> net ad random with a long sequence of input patterns and register the >>> activations. >>> >>> -I don't want the network to be trained using batch updating. Given my >>> problem, batch updating is senseless. >>> >>> So, could somebody assist me in finding the best settings for this >>> kind of requirements? >>> >>> Thanks, >>> Dieter Vanderelst >>> >>> _______________________________________________ >>> Pyro-users mailing list >>> Pyro-users@pyrorobotics.org >>> http://emergent.brynmawr.edu/mailman/listinfo/pyro-users >>> >> > -- Douglas S. Blank Associate Professor, Bryn Mawr College http://cs.brynmawr.edu/~dblank/ Office: 610 526 6501 From jamartinh at fdi.ucm.es Fri Oct 26 06:39:39 2007 From: jamartinh at fdi.ucm.es (Jose Antonio Martin H) Date: Fri Oct 26 06:43:18 2007 Subject: [Pyro-users] Using the SRN References: <4720B3BD.9060709@emailengine.org> <4720DD7F.7070304@brynmawr.edu> <4721C0D6.2040804@emailengine.org> Message-ID: <001e01c817bc$82c41c40$0301a8c0@jam> Dear Dieter, I have experienced the same exact problem with conx, that is the reason by wich I do not use conx. It seems that the C API of conx does not have an implementation of incremental learning for neural networks, this seems to be strange but I cant find the correct fucntions for doing this. If anybody has the WAY to the that , please inform to all of us both to this list of Pyro and please send a note to the list of Conx users somewhere. THNKS. jose ----- Original Message ----- From: "Dieter Vanderelst" To: "Douglas S. Blank" ; Sent: Friday, October 26, 2007 12:26 PM Subject: Re: [Pyro-users] Using the SRN > Dear Douglas, > > Thank you for your answer. > I have programmed a net based on your pointers. But I still have some > troubles. > > This is what I do: > > I use the code at http://pyrorobotics.org/?page=SRNModuleExperiments to > make an elman net. > > Then I want to train this net by setting *single* input and output pattern > repetitively: > > for each input_vector en output_vector: > network.setInputs([input_vector]) > network.setOutputs([output_vector]) > network.train() #train the network some *more* on each pass > > > Is this possible? It seems like the net is resetting itself after each > call of train since it considers each pass trough this loop a an epoch? > Can this resetting be switched off? > > > Regards, > Dieter > > > > Douglas S. Blank wrote: >> Dieter, >> >> You can use as long of sequences as you want, even from a file. >> >> See, for example, the section on off-line learning here: >> http://pyrorobotics.org/?page=Building_20Neural_20Networks_20using_20Conx >> or >> http://pyrorobotics.org/?page=Robot_20Learning_20using_20Neural_20Networks >> >> You can use the loadDataFromFile or loadInputsFromFile / >> loadtargetsFromFile. >> >> If you want to look at hidden layer activations, perhaps the easiest >> method would be to use the SRN.propagate(input=[0,1,0,0,1]) form, and >> then look at the hidden layer. For example: >> >> srn = SRN() >> # .. add layers, train >> srn.propagate(input=[0,1,0,0,1]) >> print srn["hidden"].activation >> >> Another way would be to extend the SRN class and override one of the >> methods, like postBackprop: >> >> from pyrobot.brain.conx import * >> class MySRN(SRN): >> def postBackprop(self, **args): >> print self["hidden"].activation >> SRN.postBackprop(self, **args) >> >> and use the MySRN class exactly the way that you would the SRN class. >> That would allow you to examine the hidden layer during processing. >> >> You can set batch to 0 and you shouldn't have any problem, either way. >> >> Hope that helps, >> >> -Doug >> >> Dieter Vanderelst wrote: >>> Hi, >>> >>> I need some advise on the use off SRN (simple recurrent nets). >>> >>> I know what the network does but I need some help on the Pyro >>> implementation. >>> This is what I want to do with the net: >>> -I want to train a SRN using a single (very long) sequence of patterns. >>> The examples I could find on SRN all define a number of patterns and >>> build a sequence of these on the fly. However, I will read a single long >>> sequence of patterns from a file (experimental data). >>> >>> -Second, I want to analyze the activation of the hidden nodes in >>> response to each different input pattern. To this, I want present the >>> net ad random with a long sequence of input patterns and register the >>> activations. >>> >>> -I don't want the network to be trained using batch updating. Given my >>> problem, batch updating is senseless. >>> >>> So, could somebody assist me in finding the best settings for this kind >>> of requirements? >>> >>> Thanks, >>> Dieter Vanderelst >>> >>> _______________________________________________ >>> Pyro-users mailing list >>> Pyro-users@pyrorobotics.org >>> http://emergent.brynmawr.edu/mailman/listinfo/pyro-users >>> >> > _______________________________________________ > Pyro-users mailing list > Pyro-users@pyrorobotics.org > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > From dieter_vanderelst at emailengine.org Fri Oct 26 07:10:13 2007 From: dieter_vanderelst at emailengine.org (Dieter Vanderelst) Date: Fri Oct 26 07:10:16 2007 Subject: [Pyro-users] Using the SRN In-Reply-To: <3068.71.59.123.159.1193396235.squirrel@webmail.brynmawr.edu> References: <4720B3BD.9060709@emailengine.org> <4720DD7F.7070304@brynmawr.edu> <4721C0D6.2040804@emailengine.org> <001e01c817bc$82c41c40$0301a8c0@jam> <4721C594.4050904@emailengine.org> <3068.71.59.123.159.1193396235.squirrel@webmail.brynmawr.edu> Message-ID: <4721CB15.2030507@emailengine.org> Dear Douglas, Could you tell me then how I could present a network with one input-output pair a time, and train incrementally? I found out that I should set train(cont=1) But this is as far as I get right now. If I train my net on this pair (=1 backprop step) and then offer the next one, the network is resetting. This is because it assumes that my single pair is the whole data set and that it resets itself after each n (here=1) epoch because the learning criterium was not reached. I now what catastrophic forgetting is, but in what I want to do this will not play a role. Regards, Dieter Douglas S. Blank wrote: > Jose, > > Conx doesn't have a C API---most everything is in Python (except for the > matrix multiplication). > > There is lots of support for incremental learning, as that is mostly what > the developers use conx for! We train robots, incrementally, on-line. > > I suggests you try some of the easier fixes first. But if you want to read > more about a research topic on catastrophic forgetting, you can read the > paper about the governor here: > > http://mightymouse.brynmawr.edu/~dblank/papers/sab04.pdf > > and see the code here: > > pyrobot/brain/governor.py > > -Doug > > On Fri, October 26, 2007 6:46 am, Dieter Vanderelst said: >> Hi, >> >> Yes. You point out exactly what I want. >> >> It unfortunate that the conx module has no incremental learning. >> >> Anyway, for now I will have to come up with a work-around. >> >> Regards, >> Dieter >> >> Jose Antonio Martin H wrote: >>> Dear Dieter, I have experienced the same exact problem with conx, that >>> is the reason by wich I do not use conx. >>> >>> It seems that the C API of conx does not have an implementation of >>> incremental learning for neural networks, this seems to be strange but I >>> cant find the correct fucntions for doing this. >>> >>> If anybody has the WAY to the that , please inform to all of us both to >>> this list of Pyro and please send a note to the list of Conx users >>> somewhere. >>> >>> THNKS. >>> jose >>> >>> >>> ----- Original Message ----- From: "Dieter Vanderelst" >>> >>> To: "Douglas S. Blank" ; >>> >>> Sent: Friday, October 26, 2007 12:26 PM >>> Subject: Re: [Pyro-users] Using the SRN >>> >>> >>>> Dear Douglas, >>>> >>>> Thank you for your answer. >>>> I have programmed a net based on your pointers. But I still have some >>>> troubles. >>>> >>>> This is what I do: >>>> >>>> I use the code at http://pyrorobotics.org/?page=SRNModuleExperiments >>>> to make an elman net. >>>> >>>> Then I want to train this net by setting *single* input and output >>>> pattern repetitively: >>>> >>>> for each input_vector en output_vector: >>>> network.setInputs([input_vector]) >>>> network.setOutputs([output_vector]) >>>> network.train() #train the network some *more* on each pass >>>> >>>> >>>> Is this possible? It seems like the net is resetting itself after each >>>> call of train since it considers each pass trough this loop a an >>>> epoch? Can this resetting be switched off? >>>> >>>> >>>> Regards, >>>> Dieter >>>> >>>> >>>> >>>> Douglas S. Blank wrote: >>>>> Dieter, >>>>> >>>>> You can use as long of sequences as you want, even from a file. >>>>> >>>>> See, for example, the section on off-line learning here: >>>>> http://pyrorobotics.org/?page=Building_20Neural_20Networks_20using_20Conx >>>>> >>>>> or >>>>> http://pyrorobotics.org/?page=Robot_20Learning_20using_20Neural_20Networks >>>>> >>>>> >>>>> You can use the loadDataFromFile or loadInputsFromFile / >>>>> loadtargetsFromFile. >>>>> >>>>> If you want to look at hidden layer activations, perhaps the easiest >>>>> method would be to use the SRN.propagate(input=[0,1,0,0,1]) form, and >>>>> then look at the hidden layer. For example: >>>>> >>>>> srn = SRN() >>>>> # .. add layers, train >>>>> srn.propagate(input=[0,1,0,0,1]) >>>>> print srn["hidden"].activation >>>>> >>>>> Another way would be to extend the SRN class and override one of the >>>>> methods, like postBackprop: >>>>> >>>>> from pyrobot.brain.conx import * >>>>> class MySRN(SRN): >>>>> def postBackprop(self, **args): >>>>> print self["hidden"].activation >>>>> SRN.postBackprop(self, **args) >>>>> >>>>> and use the MySRN class exactly the way that you would the SRN class. >>>>> That would allow you to examine the hidden layer during processing. >>>>> >>>>> You can set batch to 0 and you shouldn't have any problem, either way. >>>>> >>>>> Hope that helps, >>>>> >>>>> -Doug >>>>> >>>>> Dieter Vanderelst wrote: >>>>>> Hi, >>>>>> >>>>>> I need some advise on the use off SRN (simple recurrent nets). >>>>>> >>>>>> I know what the network does but I need some help on the Pyro >>>>>> implementation. >>>>>> This is what I want to do with the net: >>>>>> -I want to train a SRN using a single (very long) sequence of >>>>>> patterns. The examples I could find on SRN all define a number of >>>>>> patterns and build a sequence of these on the fly. However, I will >>>>>> read a single long sequence of patterns from a file (experimental >>>>>> data). >>>>>> >>>>>> -Second, I want to analyze the activation of the hidden nodes in >>>>>> response to each different input pattern. To this, I want present >>>>>> the net ad random with a long sequence of input patterns and >>>>>> register the activations. >>>>>> >>>>>> -I don't want the network to be trained using batch updating. Given >>>>>> my problem, batch updating is senseless. >>>>>> >>>>>> So, could somebody assist me in finding the best settings for this >>>>>> kind of requirements? >>>>>> >>>>>> Thanks, >>>>>> Dieter Vanderelst >>>>>> >>>>>> _______________________________________________ >>>>>> Pyro-users mailing list >>>>>> Pyro-users@pyrorobotics.org >>>>>> http://emergent.brynmawr.edu/mailman/listinfo/pyro-users >>>>>> >>>> _______________________________________________ >>>> Pyro-users mailing list >>>> Pyro-users@pyrorobotics.org >>>> http://emergent.brynmawr.edu/mailman/listinfo/pyro-users >>>> >>> _______________________________________________ >>> Pyro-users mailing list >>> Pyro-users@pyrorobotics.org >>> http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > > From dblank at brynmawr.edu Fri Oct 26 08:10:44 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Fri Oct 26 08:10:43 2007 Subject: [Pyro-users] Using the SRN In-Reply-To: <4721CB15.2030507@emailengine.org> References: <4720B3BD.9060709@emailengine.org> <4720DD7F.7070304@brynmawr.edu> <4721C0D6.2040804@emailengine.org> <001e01c817bc$82c41c40$0301a8c0@jam> <4721C594.4050904@emailengine.org> <3068.71.59.123.159.1193396235.squirrel@webmail.brynmawr.edu> <4721CB15.2030507@emailengine.org> Message-ID: <3330.71.59.123.159.1193400644.squirrel@webmail.brynmawr.edu> On Fri, October 26, 2007 7:10 am, Dieter Vanderelst said: > Dear Douglas, > > Could you tell me then how I could present a network with one input-output > pair a time, and train incrementally? > > I found out that I should set train(cont=1) Dieter, That should work. You can also: srn.step(input = [0, 1, 1], output = [1, 1, 0]) which will save you from having to set the inputs/targets each time. You may want to, at first, set: srn.interactive = 1 so that you can make sure that the context layer is being copied as you want. -Doug > But this is as far as I get right now. If I train my net on this pair (=1 > backprop step) and then offer the next one, the network is resetting. This > is because it assumes that my single pair is the whole data set and that > it resets itself after each n (here=1) epoch because the learning > criterium was not reached. > > I now what catastrophic forgetting is, but in what I want to do this will > not play a role. > > Regards, > Dieter > > Douglas S. Blank wrote: >> Jose, >> >> Conx doesn't have a C API---most everything is in Python (except for the >> matrix multiplication). >> >> There is lots of support for incremental learning, as that is mostly >> what >> the developers use conx for! We train robots, incrementally, on-line. >> >> I suggests you try some of the easier fixes first. But if you want to >> read >> more about a research topic on catastrophic forgetting, you can read the >> paper about the governor here: >> >> http://mightymouse.brynmawr.edu/~dblank/papers/sab04.pdf >> >> and see the code here: >> >> pyrobot/brain/governor.py >> >> -Doug >> >> On Fri, October 26, 2007 6:46 am, Dieter Vanderelst said: >>> Hi, >>> >>> Yes. You point out exactly what I want. >>> >>> It unfortunate that the conx module has no incremental learning. >>> >>> Anyway, for now I will have to come up with a work-around. >>> >>> Regards, >>> Dieter >>> >>> Jose Antonio Martin H wrote: >>>> Dear Dieter, I have experienced the same exact problem with conx, >>>> that >>>> is the reason by wich I do not use conx. >>>> >>>> It seems that the C API of conx does not have an implementation of >>>> incremental learning for neural networks, this seems to be strange but >>>> I >>>> cant find the correct fucntions for doing this. >>>> >>>> If anybody has the WAY to the that , please inform to all of us both >>>> to >>>> this list of Pyro and please send a note to the list of Conx users >>>> somewhere. >>>> >>>> THNKS. >>>> jose >>>> >>>> >>>> ----- Original Message ----- From: "Dieter Vanderelst" >>>> >>>> To: "Douglas S. Blank" ; >>>> >>>> Sent: Friday, October 26, 2007 12:26 PM >>>> Subject: Re: [Pyro-users] Using the SRN >>>> >>>> >>>>> Dear Douglas, >>>>> >>>>> Thank you for your answer. >>>>> I have programmed a net based on your pointers. But I still have some >>>>> troubles. >>>>> >>>>> This is what I do: >>>>> >>>>> I use the code at http://pyrorobotics.org/?page=SRNModuleExperiments >>>>> to make an elman net. >>>>> >>>>> Then I want to train this net by setting *single* input and output >>>>> pattern repetitively: >>>>> >>>>> for each input_vector en output_vector: >>>>> network.setInputs([input_vector]) >>>>> network.setOutputs([output_vector]) >>>>> network.train() #train the network some *more* on each pass >>>>> >>>>> >>>>> Is this possible? It seems like the net is resetting itself after >>>>> each >>>>> call of train since it considers each pass trough this loop a an >>>>> epoch? Can this resetting be switched off? >>>>> >>>>> >>>>> Regards, >>>>> Dieter >>>>> >>>>> >>>>> >>>>> Douglas S. Blank wrote: >>>>>> Dieter, >>>>>> >>>>>> You can use as long of sequences as you want, even from a file. >>>>>> >>>>>> See, for example, the section on off-line learning here: >>>>>> http://pyrorobotics.org/?page=Building_20Neural_20Networks_20using_20Conx >>>>>> >>>>>> or >>>>>> http://pyrorobotics.org/?page=Robot_20Learning_20using_20Neural_20Networks >>>>>> >>>>>> >>>>>> You can use the loadDataFromFile or loadInputsFromFile / >>>>>> loadtargetsFromFile. >>>>>> >>>>>> If you want to look at hidden layer activations, perhaps the easiest >>>>>> method would be to use the SRN.propagate(input=[0,1,0,0,1]) form, >>>>>> and >>>>>> then look at the hidden layer. For example: >>>>>> >>>>>> srn = SRN() >>>>>> # .. add layers, train >>>>>> srn.propagate(input=[0,1,0,0,1]) >>>>>> print srn["hidden"].activation >>>>>> >>>>>> Another way would be to extend the SRN class and override one of the >>>>>> methods, like postBackprop: >>>>>> >>>>>> from pyrobot.brain.conx import * >>>>>> class MySRN(SRN): >>>>>> def postBackprop(self, **args): >>>>>> print self["hidden"].activation >>>>>> SRN.postBackprop(self, **args) >>>>>> >>>>>> and use the MySRN class exactly the way that you would the SRN >>>>>> class. >>>>>> That would allow you to examine the hidden layer during processing. >>>>>> >>>>>> You can set batch to 0 and you shouldn't have any problem, either >>>>>> way. >>>>>> >>>>>> Hope that helps, >>>>>> >>>>>> -Doug >>>>>> >>>>>> Dieter Vanderelst wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I need some advise on the use off SRN (simple recurrent nets). >>>>>>> >>>>>>> I know what the network does but I need some help on the Pyro >>>>>>> implementation. >>>>>>> This is what I want to do with the net: >>>>>>> -I want to train a SRN using a single (very long) sequence of >>>>>>> patterns. The examples I could find on SRN all define a number of >>>>>>> patterns and build a sequence of these on the fly. However, I will >>>>>>> read a single long sequence of patterns from a file (experimental >>>>>>> data). >>>>>>> >>>>>>> -Second, I want to analyze the activation of the hidden nodes in >>>>>>> response to each different input pattern. To this, I want present >>>>>>> the net ad random with a long sequence of input patterns and >>>>>>> register the activations. >>>>>>> >>>>>>> -I don't want the network to be trained using batch updating. Given >>>>>>> my problem, batch updating is senseless. >>>>>>> >>>>>>> So, could somebody assist me in finding the best settings for this >>>>>>> kind of requirements? >>>>>>> >>>>>>> Thanks, >>>>>>> Dieter Vanderelst >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Pyro-users mailing list >>>>>>> Pyro-users@pyrorobotics.org >>>>>>> http://emergent.brynmawr.edu/mailman/listinfo/pyro-users >>>>>>> >>>>> _______________________________________________ >>>>> Pyro-users mailing list >>>>> Pyro-users@pyrorobotics.org >>>>> http://emergent.brynmawr.edu/mailman/listinfo/pyro-users >>>>> >>>> _______________________________________________ >>>> Pyro-users mailing list >>>> Pyro-users@pyrorobotics.org >>>> http://emergent.brynmawr.edu/mailman/listinfo/pyro-users >> >> > > > _______________________________________________ > Pyro-users mailing list > Pyro-users@pyrorobotics.org > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > -- Douglas S. Blank Associate Professor, Bryn Mawr College http://cs.brynmawr.edu/~dblank/ Office: 610 526 6501 From jamartinh at fdi.ucm.es Fri Oct 26 09:04:44 2007 From: jamartinh at fdi.ucm.es (Jose Antonio Martin H) Date: Fri Oct 26 09:03:56 2007 Subject: [Pyro-users] Using the SRN References: <4720B3BD.9060709@emailengine.org> <4720DD7F.7070304@brynmawr.edu> <4721C0D6.2040804@emailengine.org> Message-ID: <000c01c817d0$c7aa43c0$0301a8c0@jam> Yes conx does not have a C API. Im sorry , I get confused by FANN wich is a c++ library with a wrapper for python. I assumed that conx was based on FANN. I hope to se an incremental learning algorithm in conx. Best whishes. ----- Original Message ----- From: "Dieter Vanderelst" To: "Douglas S. Blank" ; Sent: Friday, October 26, 2007 12:26 PM Subject: Re: [Pyro-users] Using the SRN > Dear Douglas, > > Thank you for your answer. > I have programmed a net based on your pointers. But I still have some > troubles. > > This is what I do: > > I use the code at http://pyrorobotics.org/?page=SRNModuleExperiments to > make an elman net. > > Then I want to train this net by setting *single* input and output pattern > repetitively: > > for each input_vector en output_vector: > network.setInputs([input_vector]) > network.setOutputs([output_vector]) > network.train() #train the network some *more* on each pass > > > Is this possible? It seems like the net is resetting itself after each > call of train since it considers each pass trough this loop a an epoch? > Can this resetting be switched off? > > > Regards, > Dieter > > > > Douglas S. Blank wrote: >> Dieter, >> >> You can use as long of sequences as you want, even from a file. >> >> See, for example, the section on off-line learning here: >> http://pyrorobotics.org/?page=Building_20Neural_20Networks_20using_20Conx >> or >> http://pyrorobotics.org/?page=Robot_20Learning_20using_20Neural_20Networks >> >> You can use the loadDataFromFile or loadInputsFromFile / >> loadtargetsFromFile. >> >> If you want to look at hidden layer activations, perhaps the easiest >> method would be to use the SRN.propagate(input=[0,1,0,0,1]) form, and >> then look at the hidden layer. For example: >> >> srn = SRN() >> # .. add layers, train >> srn.propagate(input=[0,1,0,0,1]) >> print srn["hidden"].activation >> >> Another way would be to extend the SRN class and override one of the >> methods, like postBackprop: >> >> from pyrobot.brain.conx import * >> class MySRN(SRN): >> def postBackprop(self, **args): >> print self["hidden"].activation >> SRN.postBackprop(self, **args) >> >> and use the MySRN class exactly the way that you would the SRN class. >> That would allow you to examine the hidden layer during processing. >> >> You can set batch to 0 and you shouldn't have any problem, either way. >> >> Hope that helps, >> >> -Doug >> >> Dieter Vanderelst wrote: >>> Hi, >>> >>> I need some advise on the use off SRN (simple recurrent nets). >>> >>> I know what the network does but I need some help on the Pyro >>> implementation. >>> This is what I want to do with the net: >>> -I want to train a SRN using a single (very long) sequence of patterns. >>> The examples I could find on SRN all define a number of patterns and >>> build a sequence of these on the fly. However, I will read a single long >>> sequence of patterns from a file (experimental data). >>> >>> -Second, I want to analyze the activation of the hidden nodes in >>> response to each different input pattern. To this, I want present the >>> net ad random with a long sequence of input patterns and register the >>> activations. >>> >>> -I don't want the network to be trained using batch updating. Given my >>> problem, batch updating is senseless. >>> >>> So, could somebody assist me in finding the best settings for this kind >>> of requirements? >>> >>> Thanks, >>> Dieter Vanderelst >>> >>> _______________________________________________ >>> Pyro-users mailing list >>> Pyro-users@pyrorobotics.org >>> http://emergent.brynmawr.edu/mailman/listinfo/pyro-users >>> >> > _______________________________________________ > Pyro-users mailing list > Pyro-users@pyrorobotics.org > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > From chad at mgproductscnc.com Fri Oct 26 17:28:58 2007 From: chad at mgproductscnc.com (Chad George) Date: Fri Oct 26 17:28:59 2007 Subject: [Pyro-users] IPython and Pyro 5.0 Message-ID: I recently tried to get ipyrobot script to work, but it looks like some files are missing. It looks like at one point there was a "pyrobot.ipyrobot" module, but I can't find it anymore. Is this feature still supported? -Chad From dblank at brynmawr.edu Mon Oct 29 10:54:43 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Mon Oct 29 10:54:59 2007 Subject: [Pyro-users] IPython and Pyro 5.0 In-Reply-To: References: Message-ID: <4725F433.70001@brynmawr.edu> Chad George wrote: > I recently tried to get ipyrobot script to work, but it looks like > some files are missing. > > It looks like at one point there was a "pyrobot.ipyrobot" module, but > I can't find it anymore. > > Is this feature still supported? Chad, The ipyro.py file can still be found in the CVS attic here: http://cvs.cs.brynmawr.edu/cgi-bin/viewcvs.cgi/pyrobot/Attic/ipyro.py?rev=HEAD&content-type=text/vnd.viewcvs-markup But, it is largely no longer needed. At a point in the past, pyro had an experimental, very unpythonic interface. It looked something like: robot.get("/robot/sonar/range/1-4/value") This is now something like: [x.value for x in robot.sonar[0][1:4]] So, the iPython interface was largely to undo that syntax. You should be able to get by without it now. Some users spent some time getting Pyro to work in a more command-line oriented fashion (with and without ipython) and may have additional tools or suggestions. The Pyrobot GUI contains the thread that updates the robots and sensors. So, you have to do a little extra to run a command-line only. You might also want to look at http://pyrorobotics.org/?page=PyroFromPython -Doug > -Chad From swaffoj at allegheny.edu Mon Oct 29 20:20:20 2007 From: swaffoj at allegheny.edu (John Mark Swafford) Date: Mon Oct 29 20:20:26 2007 Subject: [Pyro-users] One More Non-GUI Problem Message-ID: <472678C4.9090309@allegheny.edu> Dear Users, Thanks for you suggestions so far; they have been very helpful. Unfortunately I am still having problems getting my pyrobot code to work directly from my python program without the GUI. I believe I am very close to finding my solution. Everytime I try and call my pyrobot code, I receive an "ImportError: No module named X" I tried moving the code to the pyrobot directory and then executing it and I still receive the same error. I also tried adding the directory where pyrobot is to my PYTHONPATH with the same result. When adding to my PYTHONPATH, I tried adding the sys.path.append command to my python code and I tried adding the line: export PYTHONPATH = dir/where/pyrobot/is to my .bash_profile. I am working with OS X if that makes any difference. Has anyone encountered a similar problem? Any advice would be greatly appreciated. Kind Regards, John Mark Swafford Allegheny College From dblank at brynmawr.edu Mon Oct 29 20:58:00 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Mon Oct 29 20:58:02 2007 Subject: [Pyro-users] One More Non-GUI Problem In-Reply-To: <472678C4.9090309@allegheny.edu> References: <472678C4.9090309@allegheny.edu> Message-ID: <42883.71.59.123.159.1193705880.squirrel@webmail.brynmawr.edu> On Mon, October 29, 2007 8:20 pm, John Mark Swafford said: > Dear Users, > > Thanks for you suggestions so far; they have been very helpful. > Unfortunately I am still having problems getting my pyrobot code to work > directly from my python program without the GUI. I believe I am very > close to finding my solution. Everytime I try and call my pyrobot code, > I receive an "ImportError: No module named X" I tried moving the code to > the pyrobot directory and then executing it and I still receive the same > error. I also tried adding the directory where pyrobot is to my > PYTHONPATH with the same result. When adding to my PYTHONPATH, I tried > adding the sys.path.append command to my python code and I tried adding > the line: > export PYTHONPATH = dir/where/pyrobot/is to my .bash_profile. I am > working with OS X if that makes any difference. Has anyone encountered a > similar problem? Any advice would be greatly appreciated. John Mark, Here is a test I just did to show everything one would need to do to run. This is under Linux, but should work under any UNIX. The dollar sign is the shell prompt; you enter what follows the dollar sign. I retrieve the files, build, and run (you may have already downloaded the files, so you could skip the cvs commands): $ pwd /home/dblank $ cvs -d :pserver:anonymous@cvs.cs.brynmawr.edu:/cvs login Logging in to :pserver:anonymous@cvs.cs.brynmawr.edu:2401/cvs CVS password: [PRESS ENTER] $ cvs -d :pserver:anonymous@cvs.cs.brynmawr.edu:/cvs co pyrobot cvs server: Updating pyrobot ... [takes a couple of minutes to get all files] $ cd pyrobot $ make ------------------------------------------------------------------- 1. Python version number? Default = [2.5]: [ENTER] ------------------------------------------------------------------- 2. Where are Python's include files? Default = [/usr/include/python2.5]: [ENTER] ------------------------------------------------------------------- 3. What is Python's binary? (enter path and name) Default = [/usr/bin/python2.5]: [ENTER] ------------------------------------------------------------------- 4. Where is the X11 include directory? Default = []: /usr/share/X11/ ------------------------------------------------------------------- 5. Where is the player include directory (if one, or 'none')? Default = []: none [Answer n for all of the rest of the questions.] Configuration is complete! You just created Makefile.cfg. You can run this again, or edit Makefile.cfg by hand if you need to. Now you are ready to run 'make' (if you aren't already) echo -e "# This file is automatically generated\ndef version():\n\treturn \"5.0.0\"" > system/version.py /usr/bin/python2.5 compile.py Listing . ... [Compiles a bunch of files.] echo -e "#!/usr/bin/python2.5" > bin/pyrobot cat build/pyrobot >> bin/pyrobot chmod a+x bin/pyrobot $ export PYTHONPATH=/home/dblank $ export PYROBOT=/home/dblank/pyrobot $ python Python 2.5 (r25:51908, Apr 10 2007, 10:29:13) [GCC 4.1.2 20070403 (Red Hat 4.1.2-8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pyrobot >>> from pyrobot.simulators.pysim import * >>> from pyrobot.robot.symbolic import Simbot >>> ^d Does that fail at any place? -Doug > Kind Regards, > John Mark Swafford > Allegheny College