opencog / moses

MOSES Machine Learning: Meta-Optimizing Semantic Evolutionary Search. See also AS-MOSES https://github.com/opencog/asmoses but kept to guaranty backward compatibility.
https://wiki.opencog.org/w/Meta-Optimizing_Semantic_Evolutionary_Search
Other
126 stars 84 forks source link

make examples fails for target trap-uni #105

Closed gl-yziquel closed 11 months ago

gl-yziquel commented 12 months ago

I guess this is an instance of bit rot.

mini-me@virtucon ~/h/c/m/build (master)> make examples
Consolidate compiler generated dependencies of target trap-uni
[93%] Building CXX object examples/example-progs/CMakeFiles/trap-uni.dir/trap-uni.cc.o
/home/mini-me/home/cellar/moses/examples/example-progs/trap-uni.cc:97:44: error: ‘_1’ was not declared in this scope
   97 |                     bind(&trap::vee, this, _1)),
make[6]: *** [examples/example-progs/CMakeFiles/trap-uni.dir/build.make:76: examples/example-progs/CMakeFiles/trap-uni.dir/trap-uni.cc.o] Error 1
make[5]: *** [CMakeFiles/Makefile2:3159: examples/example-progs/CMakeFiles/trap-uni.dir/all] Error 2
make[4]: *** [Makefile:156: all] Error 2
make[3]: *** [CMakeFiles/examples.dir/build.make:71: CMakeFiles/examples] Error 2
make[2]: *** [CMakeFiles/Makefile2:982: CMakeFiles/examples.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:989: CMakeFiles/examples.dir/rule] Error 2
make: *** [Makefile:228: examples] Error 2
mini-me@virtucon ~/h/c/m/build (master) [2]>
linas commented 11 months ago

Yes. It is fairly easy to fix: use #include <boost/bind/bind.hpp> instead of #include <boost/bind.hpp> and then write boost::placeholders::_1 instead of the naked _1

However, I'm not fixing this: I see other warnings during the compile, and I'm not ready to single-handedly maintain this. Anyway, more or less everything in MOSES is now in as-moses, which is still maintainable. So MOSES should now be considered deprecated/obsolete.

I'll merge pull reqs, though, if you provide them.

gl-yziquel commented 11 months ago

Thanks.

I'll see if I find time to provide such pull requests. Unlikely, but nonetheless possible. Depends.

gl-yziquel commented 11 months ago

Hmmmh.... not quite: it seems that my code is reference boost/mpl/bind.hpp. gcc -H seems to tell me that this is pulled via opencog/util/functional.h, itself pulled by opencog/util/selection.h.

I wouldn't be too surprised if this were due to cogutil having evolved over time away from the runtime boost bind to the compile time boost mpl bind.

linas commented 11 months ago

I've cleaned up many of the problems in pull req #107

However, I suggest focusing on as-moses, as that is the next-gen version of this code base.

linas commented 11 months ago

Works for me.

gl-yziquel commented 11 months ago

I confirm that this fixes the issue.

It's been a few times you told me to switch to asmoses. So I'll address the implicit assumption behind that:

I am interested in moses because I am reading the documentation of various opencog stuff in a historical perspective, much like I do for many other things. I therefore wish to have handy the softwares that are referenced in the old docs of opencog. For instance, I need to understand how the AtomSpace developed from the AtomTable and Combo. So I'll keep working on these old pieces of code for various reasons such as this one.

I'm not asking you to maintain them.

When I'll be able to fix something, I'll try.

But, for the moment, given the complexity of entering into the opencog codebase, I do not consider it dumb or heretical to try to get old code to resurrect if that is what is needed to get some perspective.

If I'd need to compile some SNOBOL4, I'd compile some SNOBOL4.

linas commented 11 months ago

Well, if you want to ask questions, I can act as a guide. Yes, the codebase is complex; but the general basic principles are not that hard. Let me try an informal summary here, for MOSES.

That's it. If you don't know what "random forest models" are, you should look at that topic.

And so, here we are, in modern times:

As to the future:

All that is a generic software maintenance issue: modular code, small, maintainable pieces, each subsystem is easier to understand, but-fix, unit-test, enhance. OpenCog is not magically exempt from standard laws of software development.

Anyway .. there we are...

linas commented 11 months ago

Oh, huh. I lied. I mis-spoke. I just skimmed https://en.wikipedia.org/wiki/Random_forest and ... well, MOSES is not that. There are a lot of similarities between MOSES-style combo trees, for combining inputs, and the "decision trees" used in random forest models. But there are also stark differences. So: