Re: openBeagle

106 views
Skip to first unread message

Christian Gagné

unread,
Feb 13, 2013, 6:57:50 AM2/13/13
to marc....@ambrosys.de, openbeag...@googlegroups.com
Dear Marc,

These problems are very probably caused by the use of your version of GCC, which is much more recent than the one we used to compile these version of the librairies. I do not have GCC 4.7 at hand, my Mac is still on 4.2 (Apple version), but the fixes should be light to do. It is mostly a matter of adapting the code to GCC 4.7.

As for the stable version, it is probably required to add some headers, in order to get the exit and memset functions within the current scope. Similar problems arised in the past, when we moved toward a more recent version of GCC.

As for the development version, it is less obvious, but may again be caused by a change in the behaviour of GCC 4.7 vs the older versions. From what I get of the error message, the following one it quite interesting.

> note: declarations in dependent base ‘std::vector<std::pair<double, unsigned int> >’ are not found by unqualified lookup
> note: use ‘this->push_back’ instead

It tells what it tells. I would suggest you to replace the push_back call at RouletteT.hpp:89:3 by this->push_back and see whether that fix the problem.

Best,

Christian


On 2013-02-13, at 6:30 AM, Marc Segond <gnum...@gmail.com> wrote:

> Dear Christian,
> I send you this email to ask for some help installing openBeagle. I am trying to use it and downloaded both the stable and alpha versions, and I cannot manage to have them compile.
> For the stable version, the ./configure step goes well, but then the make gives me this error which I cannot figure out where it comes from:
>
> In file included from libpacc-util.cpp:5:0:
> SignalHandler.cpp: In static member function 'static void PACC::SignalHandler::popAction(PACC::SignalHandler::SignalType)':
> SignalHandler.cpp:142:2: error: 'exit' was not declared in this scope
> SignalHandler.cpp:144:2: error: 'exit' was not declared in this scope
> SignalHandler.cpp:153:2: error: 'exit' was not declared in this scope
> SignalHandler.cpp: In static member function 'static void PACC::SignalHandler::pushAction(PACC::SignalHandler::SignalType)':
> SignalHandler.cpp:161:2: error: 'exit' was not declared in this scope
> SignalHandler.cpp: In static member function 'static void PACC::SignalHandler::runAction(int)':
> SignalHandler.cpp:171:2: error: 'exit' was not declared in this scope
> SignalHandler.cpp:172:2: error: 'exit' was not declared in this scope
> SignalHandler.cpp: In member function 'void PACC::SignalHandler::setCustomAction(PACC::SignalHandler::SignalType)':
> SignalHandler.cpp:186:2: error: 'exit' was not declared in this scope
> SignalHandler.cpp: In static member function 'static void PACC::SignalHandler::setDefaultAction(PACC::SignalHandler::SignalType)':
> SignalHandler.cpp:208:2: error: 'exit' was not declared in this scope
> SignalHandler.cpp: In static member function 'static void PACC::SignalHandler::setIgnoreAction(PACC::SignalHandler::SignalType)':
> SignalHandler.cpp:229:2: error: 'exit' was not declared in this scope
> In file included from libpacc-util.cpp:7:0:
> Tokenizer.cpp: In member function 'bool PACC::Tokenizer::getNextToken(std::string&)':
> Tokenizer.cpp:93:2: error: 'exit' was not declared in this scope
> Tokenizer.cpp: In member function 'int PACC::Tokenizer::peekNextChar()':
> Tokenizer.cpp:188:2: error: 'exit' was not declared in this scope
> Tokenizer.cpp: In member function 'void PACC::Tokenizer::putbackToken(const string&)':
> Tokenizer.cpp:204:2: error: 'exit' was not declared in this scope
> Tokenizer.cpp: In member function 'void PACC::Tokenizer::setDelimiters(const string&, const string&)':
> Tokenizer.cpp:228:44: error: 'memset' was not declared in this scope
> Tokenizer.cpp:233:3: error: 'exit' was not declared in this scope
> make[2]: *** [libpacc-util.lo] Error 1
> make[2]: Leaving directory `/home/marc/beagle-3.0.3/PACC/Util'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/marc/beagle-3.0.3/PACC'
> make: *** [all-recursive] Error 1
>
> Concerning the Alpha version, the cmake . goes well, but then the make gives me this error:
>
> In file included from /home/marc/OpenBEAGLE-4.0.0-alpha2-Source/src/beagle/Beagle.hpp:111:0,
> from /home/marc/OpenBEAGLE-4.0.0-alpha2-Source/src/beagle/SelectRouletteOp.cpp:36:
> /home/marc/OpenBEAGLE-4.0.0-alpha2-Source/src/beagle/RouletteT.hpp: In instantiation of ‘void Beagle::RouletteT<T>::insert(const T&, double) [with T = unsigned int]’:
> /home/marc/OpenBEAGLE-4.0.0-alpha2-Source/src/beagle/SelectRouletteOp.cpp:64:43: required from here
> /home/marc/OpenBEAGLE-4.0.0-alpha2-Source/src/beagle/RouletteT.hpp:89:3: error: ‘push_back’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
> /home/marc/OpenBEAGLE-4.0.0-alpha2-Source/src/beagle/RouletteT.hpp:89:3: note: declarations in dependent base ‘std::vector<std::pair<double, unsigned int> >’ are not found by unqualified lookup
> /home/marc/OpenBEAGLE-4.0.0-alpha2-Source/src/beagle/RouletteT.hpp:89:3: note: use ‘this->push_back’ instead
> make[2]: *** [CMakeFiles/openbeagle.dir/src/beagle/SelectRouletteOp.cpp.o] Error 1
> make[1]: *** [CMakeFiles/openbeagle.dir/all] Error 2
> make: *** [all] Error 2
>
> I am using the latest Ubuntu with g++ 4.7.2
>
> I would greatly appreciate any advice on what I might be doing wrong.
>
> Best regards
>
> Marc
>
> --
> Dr. Marc Segond, Post-doctoral researcher
>
> Ambrosys GmbH - Gesellschaft für Management komplexer Systeme
> Geschwister-Scholl-Str. 63a
> D-14471 Potsdam
>
> Tel: +49 15224130212
>
> Ambrosys GmbH - Gesellschaft für Management komplexer Systems
> Gesellschaft mit beschränkter Haftung
> Sitz der Gesellschaft: Geschwister-Scholl-Str. 63a, 14471 Potsdam
> Registergericht: Amtsgericht Potsdam, HRB 21228 P
> Geschäftsführer: Karsten Ahnert, Markus Abel
>

--
Christian Gagné
http://vision.gel.ulaval.ca/~cgagne



Christian Gagné

unread,
Feb 19, 2013, 11:53:42 AM2/19/13
to marc....@ambrosys.de, openbeag...@googlegroups.com
Hi Marc,

That's expected that what you did does not work properly. Indeed, the ERC primitive instance in the primitive set is not the same that the instances in the GP trees. The behaviour of ERC is somewhat particular, as once you use it in a tree, a random value is assigned to the primitive. Changing it through the primitive set does not make sense, as there are many of these ERC that are used in the trees, possibly even many in a given tree, and each of them may have different values. Therefore, you cannot assign them with a new value through the primitive set. Only the ERC instance in the primitive set will gave its value changed.

Moreover, if you want to change the ERC value directly in the tree, there are important side-effects. Indeed, the primitive instance may be referred by several distinct nodes in distinct trees, such that if you change the value of the ERC primitive in a tree, it will change it for the other nodes referring to the same ERC. What you need to do it to create a new ERC with the desired value and replace the current ERC with the new one in the GP tree.

I hope this is helpful,

Christian




On 2013-02-19, at 6:12 AM, Marc Segond <gnum...@gmail.com> wrote:

> Hi Christian,
> sorry to bother again, but I have a problem with Beagle which I cannot manage to understand.
> Just before evaluating and individual, I want to change the value of the ERCs. I use basically this code (in the case I want to set the ERC j to 0):
>
> GP::PrimitiveSet pSet = inIndividual[i]->getPrimitiveSet(ioContext);
> Beagle::WrapperT<double> Double;
> Double.setWrappedValue(0.);
> pSet[j]->giveReference(1, ioContext)->setValue(Double);
>
> The problem is that it seems that it doesn't actually change the ERC in the individual although I check that the value is changed in the pSet (setting all the ERCs to 0 gives me the same fitness value as before).
>
> What did I do wrong?
>
> Best regards.
>
> Marc
>
> On 02/15/2013 04:11 PM, Christian Gagné wrote:
>> Hi Marc,
>>
>> To get the ERC, simply check the name of each primitives (through GP::Tree::getName()), and when the name correspond to an ERC, keep a reference on it. That should be very simple, the GP tree are packed into std::vector, one for-loop over it will allow you to check the whole tree. As for the name of the ERC, you set it when you insert the ERC primitive in the primitive set, default name is "E", as far as I remember.
>>
>> Best,
>>
>> Christian

Christian Gagné

unread,
Feb 19, 2013, 11:55:51 AM2/19/13
to marc....@ambrosys.de, openbeag...@googlegroups.com
Hi again Marc,

Caching is done through a flag in the fitness value, such that individuals that are not modified through crossover or mutation will not get their fitness evaluated again. Calling the Individual::run() for an individual will execute it again properly, there is no caching done there.

Christian



On 2013-02-19, at 7:01 AM, Marc Segond <gnum...@gmail.com> wrote:

> Dear Christian,
> thinking a bit more about it, I would have a more precise question: is there in Beagle a mechanism that makes that if we call run() for an individual, it will not be re-evaluated in the same generation if we call run again, but just use it's fitness in cache? (makes sense to save time in classical regression) This could be my problem.
>
> Best regards
>
> Marc
>
> On 02/15/2013 04:11 PM, Christian Gagné wrote:
>> Hi Marc,
>>
>> To get the ERC, simply check the name of each primitives (through GP::Tree::getName()), and when the name correspond to an ERC, keep a reference on it. That should be very simple, the GP tree are packed into std::vector, one for-loop over it will allow you to check the whole tree. As for the name of the ERC, you set it when you insert the ERC primitive in the primitive set, default name is "E", as far as I remember.
>>
>> Best,
>>
>> Christian
>>
>>

Marc Segond

unread,
Feb 19, 2013, 1:57:45 PM2/19/13
to openbeag...@googlegroups.com
Hi Christian,
thanks a lot for your answer. It shows that I did not yet fully understand the way OpenBeagle works. I will try to do what you advice me, though I did not yet understand how to create and replace an ERC in a Tree.
I will keep you up to date about the integration of DE in OpenBeagle.

Thanks again.

Best regards

Marc
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "openbeagle-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openbeagle-use...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Christian Gagné

unread,
Feb 19, 2013, 2:07:15 PM2/19/13
to openbeag...@googlegroups.com
Hi Marc,

Some points to mention that might help you to understand how ERC are implemented:

- Nodes in GP trees have a reference to a primitive. Usually, the pointed primitive is not copied. For example, there is one ADD primitive created in the primitive set and all nodes that are using it have simple a pointer to that primitive. There is only one instance of the ADD primitive.

- ERC is working differently, as each specific value is contained into a different instance. And the "mother" ERC is in the primitive set. The way it works is that there is a mValue member in that primitive. When the mValue is a NULL pointer, then it is a "mother" ERC put into the primitive set. But when we are using that primitive in a GP tree, then the random value of the ERC is created and assigned to the mValue member. From that point on, the ERC instance behave like an usual primtive. Copies of the primitive in other trees do not imply new instances, all node are pointing to the same ERC of a given value.

- A key method that implements that trick is GP::EphemeralT<T>::giveReference. I advice you to look at it as starting point if you want to understand how things are working internally.

Best,

Christian

Marc Segond

unread,
Feb 19, 2013, 2:21:31 PM2/19/13
to openbeag...@googlegroups.com
Hi Christian,
so if I get it right, I should parse the GP trees of my individuals and get references to the ERC to get their values. Then, if I want to change the value of a particular ERC of one tree, I have to create a new ERC and make the node of the tree point to this new ERC, right?
One thing I don't get clear though: a primitive set is created for every individual? Can I retrieve for each individual the references to its ERCs going through its primitive set, and then, once identified in which position are the references to the ERCs, create my new ERC and change the reference?
Sorry to be so unclear, but adding to the fact that I am quite new to Beagle, I am coming back to C++ after many many years.

Best,

Marc

Christian Gagné

unread,
Feb 19, 2013, 2:28:40 PM2/19/13
to Marc Segond, openbeag...@googlegroups.com
Hi Marc,

See my answers below in your message.

Christian



On 2013-02-19, at 2:21 PM, Marc Segond <gnum...@gmail.com> wrote:

> Hi Christian,
> so if I get it right, I should parse the GP trees of my individuals and get references to the ERC to get their values. Then, if I want to change the value of a particular ERC of one tree, I have to create a new ERC and make the node of the tree point to this new ERC, right?

Yes, that's correct. You can identify your ERC through their name, by calling method getName().

> One thing I don't get clear though: a primitive set is created for every individual? Can I retrieve for each individual the references to its ERCs going through its primitive set, and then, once identified in which position are the references to the ERCs, create my new ERC and change the reference?

No, there is a primitive super set for the whole population, which can include one or several primitive sets. The primitive sets are shared between the individuals. Moreover, the ERCs with values are not put back into the primitive set, you can access to the "mother" ERC, but that's it, you do not have access to the ones with values in it.

Marc Segond

unread,
Feb 20, 2013, 9:49:40 AM2/20/13
to Christian Gagné, openbeag...@googlegroups.com
Hi Christian and all OpenBeagle users.
Finally, I managed to make the DE for ERC optimization work.
I would now like to know if there is a way get directly statistics like
the fitness evolution to be plotted in gnuplot for example, or if one
has to write a parser for the XML file?
Maybe someone already did something to read the XML file?

Best

--
Marc

Jeannie.Fitzgerald

unread,
Feb 20, 2013, 10:32:43 AM2/20/13
to openbeag...@googlegroups.com
Hi

You can use the beagle vizualiser program: beagleviz. This generates svg files for you, but also puts all of the
data for each aspect that you choose to log( eg avg, min, max fitness, tree size) into spreadsheet files. You can use the data in these for gnuplot or R, or whichever is your plotting program of choice.

You will find the program in the source directory.

all the best,

jeannie
winmail.dat

Marc Segond

unread,
Feb 20, 2013, 11:41:24 AM2/20/13
to openbeag...@googlegroups.com
Great! Thanks a lot Jeannie!!

Best

Marc

Le 20 févr. 2013 à 16:37, "Jeannie.Fitzgerald"
<Jeannie.F...@ul.ie> a écrit :
> <winmail.dat>

Christian Gagné

unread,
Feb 20, 2013, 11:43:31 AM2/20/13
to openbeag...@googlegroups.com
Hi,

Jeannie is right. However note that visualizer is currently deprecated, such that it may not support the latest file format.

Best,

Christian
> <winmail.dat>

Marc Segond

unread,
Feb 20, 2013, 11:44:32 AM2/20/13
to openbeag...@googlegroups.com
Thanks for the info Christian.

Best

Marc

Jeannie.Fitzgerald

unread,
Feb 20, 2013, 11:46:12 AM2/20/13
to openbeag...@googlegroups.com

Hi all,

I have been using it with the 4 alpha version without any problem.

all the best,

j
winmail.dat

Marc Segond

unread,
Feb 20, 2013, 11:47:49 AM2/20/13
to openbeag...@googlegroups.com
Perfect then!

Best.

Marc

Marc Segond

unread,
Feb 20, 2013, 12:47:33 PM2/20/13
to openbeag...@googlegroups.com
Sorry to ask, but where do I find the visualizer?

I cannot find it in the OpenBeagle archive.

Best

Marc

Jeannie.Fitzgerald

unread,
Feb 20, 2013, 12:55:28 PM2/20/13
to openbeag...@googlegroups.com
Hi,

No trouble:-) Here is the path on my system:

/OpenBEAGLE-4.0.0-alpha2-Source/visualizer-0.2.1/visualizer/src

Now, I have been using OB for quite a while - so it is possible that I copied the
apps from an earlier version and have forgotten!


good luck.
winmail.dat

Christian Gagné

unread,
Feb 20, 2013, 1:40:34 PM2/20/13
to openbeag...@googlegroups.com
Hi Marc,

It is available at this page.

https://code.google.com/p/beagle/downloads/detail?name=visualizer-0.2.1.tar.gz

You can view it from the Downloads section only when you are searching for the deprecated packages.

Christian
Christian Gagné
http://vision.gel.ulaval.ca/~cgagne



Marc Segond

unread,
Feb 20, 2013, 2:25:13 PM2/20/13
to openbeag...@googlegroups.com
Thanks! It works perfectly!

Best

Marc
Reply all
Reply to author
Forward
0 new messages