opencog / rocca

Rational OpenCog Controlled Agent (ROCCA). Use OpenCog to control a rational agent in OpenAI Gym and Malmo environments.
GNU Affero General Public License v3.0
30 stars 18 forks source link

CartPole notebooks and refactoring #32

Closed ntoxeg closed 2 years ago

ntoxeg commented 2 years ago

This adds the notebook for CartPole learning from the WIP PR that I will close, so that the intermediate results are available to all.

Additionally, a I did a bunch of refactoring:

ntoxeg commented 2 years ago

@ngeiswei 🔔

ntoxeg commented 2 years ago

Rebuilding my Docker images as PLN now needs spacetime and I had to adjust the build order for that.

ngeiswei commented 2 years ago

Thanks @ntoxeg

ngeiswei commented 2 years ago

@ntoxeg, I've got the feeling that OpencogAgent.log_level isn't used anywhere. If so, unless you intend to have it used somewhere, I'd like to remove it. Let me know.

ngeiswei commented 2 years ago

I also don't understand why you construct the atomspace outside of OpencogAgent construction. For instance I want to introduce multiple atomspaces, one containing percepta, another one containing cognitive schematics and a third one for working memory, it makes little sense to construct them outside of OpencogAgent, especially given that the user can always access them via OpencogAgent attributes.

So unless you can rationalize that decision I'm gonna move atomspace construction back inside OpencogAgent.

ngeiswei commented 2 years ago

So unless you can rationalize that decision

OK, I get it, it's because the action space requires an atomspace, isn't it? Otherwise the example agent constructs an atomspace that is different than that constructed inside OpencogAgent.

I need to think more about it now.

ngeiswei commented 2 years ago

My current decision is to keep the atomspace constructed outside of OpencogAgent as working atomspace, and construct percepta and cognitive schematics atomspaces inside OpencogAgent. It requires a minimal amount of change and will not alter the current API. We may decide to alter the API later on, but it does not have to be today.

ntoxeg commented 2 years ago

So unless you can rationalize that decision

OK, I get it, it's because the action space requires an atomspace, isn't it? Otherwise the example agent constructs an atomspace that is different than that constructed inside OpencogAgent.

I need to think more about it now.

Yes, my primary intention there was to deal somehow with potentially ambiguous AtomSpace allocation and ownership.

I guess one simple change could be to not have an AtomSpace for the action space, as it doesn’t seem to be really needed, of course that means that the agent itself has to add necessary info to its own AtomSpace.