-
Notifications
You must be signed in to change notification settings - Fork 723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start of refactoring of openpsi framework #2899
Conversation
psi-satisfy is the name of the guile binding added
this moves the logic from scheme wrapper to the implicator, because that way it would be possible to add other bindings
This grounds the implicand of an ImplicationLink if the implicant is satisfiable.
The aim is to port the psi-rule definition to c++, and add an index to minimize the discovery of context action and goal from the rule
Also update psi-set-controlled-rule as controlled rules are identified by names, and add a function for naming/aliasing rules.
This breaks OpenPsiUTest. Also expose psi-imply for grounding using the cached groundings of contexts
I assume that you are doing this for performance reasons. However, there are still multiple issues related to demands and modulators that were never fully resolved, and it might not be a good idea to convert those into C++ as that would make the long-term fix harder. |
What would be nice is to have openpsi inherits from a more abstract "action selection goal driven" component, that doesn't contains the notions of urges and demands, merely goals and actions. We'll probably find that such a component will be re-used by more and more by other parts as time goes. |
Nil, yes, I absolutely agree. I wanted to go one step farther, and define a way of saying "in this situation, try to compose these actions to achieve this goal, but in this other situation, pick from this different set of actions (to achieve the same goal, or maybe a different goal?)" The "in this situation" would be the demand. This is easy to say, and its fairly easy to imagine. But when I tried to refactor the openpsi code to do this, it was hard, I tripped over multiple issues. I still think that having a working urge/demand subsystem is generically a good and useful thing do do, but we just don't have that yet. |
@linas This changes are being made not only for performance but also for using the variable groundings for instantiating the actions. Why not use the PutLink? b/c it assumes a one to one mapping which is not necessarily the case when it comes to ghost rules. Yes, in terms of representation having two type of ImplicationLink, where one is used to define the relation between action and goals, and the other between context and action seems more flexible. And would be helpful for experimenting with reinforcement learning. If you guys agree on that representation, then making the changes is simple. @ngeiswei |
@amebel regarding the 2 types of implication links you mean something like
right? No problem as long as you introduce predicates |
Nil, Yes, the old opensi wrote all rules in the form 2. Yes, the new openpsi should consider 1. and 2. to be equivalent. In general, we will want to chain these rules together in a sequence e.g. to climb stairs, take multiple steps, one after another. But also in parallel: e.g. to make someone laugh, make a funny face and fall down. I do not yet understand how this chaining will work. Naively, it would be
and somehow each of these gets closer to the goal of "stand-on-top-of-staircase" But I've never seen any detailed writeup of what the atomese looks like for this, and how PLN or the chainers solve this. |
@ngeiswei what I am thinking is more like
This way we will be able to define actions that do not achieve a goal(aka high-level goal), but only change the state of the world(aka context). So how to relate the action sequences to a goal? I think that is what URE is good at(aka planning), and is where the opportunity for experimenting on reinforcement learning is at. I think it also intersects with what you are doing with inference control, but I might be wrong. |
I like this suggestion. It makes chaining clear. |
But the probability of achieving a certain goal by doing a certain action depends on a context, perhaps you want to say
Or perhaps you consider that the truth of C has already been evaluated and so you can express What PLN needs to reason about planning is taking into account temporal knowledge, so that it can make the difference between a context that is true now, or that will be true in the future, etc. For that it needs |
Yes that was what I was thinking, If I understood you correctly then, what you are saying is that if we have
then we have,
That assumes you know your goal. A goal is just a preferred context to be in. But what if you don't know what the goal is(perception is weak), or you don't know the action to the goal, or it takes multiple actions with no clear sub-goals to reach it, how should we represent it? The present representation in openpsi is
which I think is lacking, of course I could be missing something. openpsi-dynamics uses PredictiveImplication. I understand that ImplicationLink declare direction of relationships, but don't imply temporal order. I wonder whether it would be a good idea to delegate that information to the implicant and implicand such that the same set of pln-rules could be used over any set on which a comparator is defined. |
I think it all comes down to using temporal knowledge properly, otherwise you'll have incorrect assertions, for instance if right now As far as I see things, the goal should always known, the uber goal at least. For the sub-goals it's up to the system to discover them, and they're not different from contexts that you may reach along the way. |
@amebel said:
The sequential and I suppose is only used to not shuffle the order and know where is the action and where is the context, right? |
The |
Main functionality added is the ability to instantiate actions using groundings from context.
This break OpenPsiUTest. Need to resolve #2898 before fixing the unit test failure, or might not be needed as refactoring continues.