how is atomspace time representation?

115 views
Skip to first unread message

Dagim Sisay

unread,
Oct 15, 2018, 11:05:30 AM10/15/18
to opencog
From the new spacetime wiki article here position representation look clear. 
The way I understand it, one should do something like this. 
Valuation
   PredicateNode "position"
   ConceptNode "face"
      LinkValue
         FloatValue $X
         FloatValue $Y
         FloatValue $Z

or 

   PredicateNode "position"
   ConceptNode "face"
      FloatSeqValue $X $Y $Z

^ if FloatValue and FloatSeqValue are going to be separate things after atomspace #1880

and this looks great... continually updating the values is much simpler and
they can be easily queried. 

how is time suppose to be represented though? for example to remember (recall) some
occurrence along with the time of its incidence and also to pay something attention to 
when it repeatedly occurs?

Linas Vepstas

unread,
Oct 15, 2018, 11:32:26 PM10/15/18
to opencog, Misgana Bayetta
Hi,

On Mon, Oct 15, 2018 at 10:05 AM Dagim Sisay <dagi...@gmail.com> wrote:
From the new spacetime wiki article here position representation look clear. 
The way I understand it, one should do something like this. 
Valuation
   PredicateNode "position"
   ConceptNode "face"
      LinkValue
         FloatValue $X
         FloatValue $Y
         FloatValue $Z

or 

   PredicateNode "position"
   ConceptNode "face"
      FloatSeqValue $X $Y $Z

^ if FloatValue and FloatSeqValue are going to be separate things after atomspace #1880

Use FloatSeqValue ... Doing the LinkValue and three FloatValues is horribly, terribly inefficient, both for RAM usage and runtime usage and for storage complexity.  The reason that FloatSeqValue was invented was to avoid the horrors of using singleton floats.  The reason that singleton-floats do NOT exist is to prevent people from making such a terrible design mistake.
 

and this looks great... continually updating the values is much simpler and
they can be easily queried. 

Yes, conceptually, this is what it will seem like, if you use the spacetime server.  However, under the covers, that is not what actually happens. It won't matter to you, the user, because, for the user, it will seem like the above is what is happening...

The spacetime server will store the positions in an octree, and, whenever you ask for the value, you will always get the latest and greatest value.  For efficiency reasons, the values attached to the atoms never actually change; instead, things inside the octomap change.  But, for you, it will behave as if the values were changing all the time.

To make this work, you will use PositionValue instead of FloatSeqValue.  The PositionValue c++ class "automatically knows" to look in the octomap to get the current location.

So the API might be:

   PredicateNode "current-position"
   ConceptNode "face 42"
      PositionValue

Notice that $X $Y $Z is gone ... if you want to get the position (in C++) you first get your hands on an instance of the C++ class PositionValue and then call method `value()` which returns  std::vector<double> which holds the position. Under the covers, the value() method looks into the octomap to find what it needs.

Now comes the tricky part: how do you get your hands on a PositionValue? More importantly, one that knows where to find the right position?  There are several ways to do this, I worked this out with Misgana a month ago, and don't recall quite what we agreed to.  This should be in some github issue ... !?

I think we agreed to a two-part implementation.

Part A)  The PositionValue constructor takes two arguments: "what", and "when". For example: "what" could be (Concept "face 42") and "when" could be (Predicate "right-now").   Once you run the constructor, you can save this PositionValue wherever you want; it always knows how to respond.

Part B) There is a GroundedPredicateNode "octomap-object-tracking-value"  which you use like this:

EvaluationLink
    GroundedPredicateNode "octomap-object-tracking-value"
    ListLink
         Concept "face 42"
         Predicate "right now"

and when you evaluate it, you get back a pointer to a PositionValue from Part A)

Part B) is needed, because Part A) alone is not atomese: calling the constructor is awkward, the scheme bindings are awkward, the python bindings are awkward.  Part B) eliminates this awkwardness.  Part B) is pure atomese.

 If you want the position one-half hour ago, it will be something like this:

EvaluationLink
    GroundedPredicateNode "octomap-object-tracking-value"
    ListLink
         Concept "face 42"
        TimeNode "-00:30:00"   ;;; understood as a half-hour offset from "right now"
  
Misgana is working out the exact details of this.  I don't recall if it's called PostionValue or LocationValue.  I'm not sure of what the AtTimeLink syntax is supposed to be.

I'm not sure what github issue this is covered under.



how is time suppose to be represented though?

The spacetime server will have a way of attaching timestamps to atoms, without using positions.  I don't remember the proposed API to it.
 
for example to remember (recall) some
occurrence along with the time of its incidence and also to pay something attention to 
when it repeatedly occurs?

Good question.  Short answer is "I don't know, but could probably make something up".  Right now, I strongly advise you to try to make something up, yourself. Its good practice.  Then describe it; we can talk about it, and see if we can find a better way (or at least, a way that is consistent with the current system).

Please remember to think of values as being interactive and dynamic, instead of being static data stores. That is, all class Values have a c++ method value() on it. You can overload that method, and, when you call it, it can go off and do arbitrarily-complicated things, before returning std::vector<double>.  A working example can be found in RandomValue.cc, which creates a magic number every time it is called.

Please also imagine an API that looks like Part B), so that  it works like this:

EvaluationLink
     GroundedPredicateNode "recall some occurrence"
     ListLink
          Concept "somehow"
          Concept "somewhat"
          Concept "anything else"

That is, the API should be in Atomese.  The somehow/somewhat gets passed to some special Value that does the right thing to recall things.  I don't know what somehow/somewhat might be -- you have to invent that part.

For example:

EvaluationLink
     GroundedPredicateNode "when is the last time I saw this?"
     ListLink
          Concept "red dress"
        
or

EvaluationLink
     GroundedPredicateNode "how many times have I seen this before?"
     ListLink
          Concept "red dress"

or

EvaluationLink
     GroundedPredicateNode "how many times have I seen this before?"
     ListLink
          InheritanceLink
                 Concept "red"
                 Concept "dress"

I'm not sure how to boost the attention value of something that has been seen X times before. That's a different problem.  How to attach values to the attention system, I don't know.

-- Linas

p.s. What I wrote above should go into either some github issue, or some wiki page, or some tutorial, or maybe all three.

--
cassette tapes - analog TV - film cameras - you

Nil Geisweiller

unread,
Oct 16, 2018, 2:05:02 AM10/16/18
to ope...@googlegroups.com, Linas Vepstas, Misgana Bayetta
On 10/16/18 6:32 AM, Linas Vepstas wrote:
> EvaluationLink
> GroundedPredicateNode "octomap-object-tracking-value"
> ListLink
> Concept "face 42"
> Predicate "right now"

What about using a TimeNode "right-now", or a nullary NowTimeLink?

Nil

Linas Vepstas

unread,
Oct 16, 2018, 3:23:24 AM10/16/18
to Nil Geisweiller, opencog, Misgana Bayetta
Sure. What I wrote was a sketch, rather than a formal spec. 
Reply all
Reply to author
Forward
0 new messages