Ai Dreams Forum

Member's Experiments & Projects => General Project Discussion => Topic started by: Zero on December 16, 2019, 11:22:52 AM

Title: Thinkbot
Post by: Zero on December 16, 2019, 11:22:52 AM
The thinkbot project, at last.

https://github.com/ThinkbotsAreFree/thinkbot
Title: Re: Thinkbot
Post by: Zero on December 17, 2019, 01:58:52 PM
Basic loading structures are done. https://github.com/ThinkbotsAreFree/thinkbot/wiki (https://github.com/ThinkbotsAreFree/thinkbot/wiki)

Now's the moment of truth: the main loop.

Hey, nice xmas skin, Freddy!
Title: Re: Thinkbot
Post by: Zero on December 17, 2019, 04:04:52 PM
I'm exploring Seneca (http://senecajs.org/getting-started/), an interesting "microservices toolkit for Nodejs". I like the idea.
Title: Re: Thinkbot
Post by: Zero on December 18, 2019, 08:34:29 AM
Switching back to Lunr instead of elasticLunr, because the elasticLunr doesn't understand in-query AND/OR combinations correctly. Smells like crap.

And... elasticLunr is ugly, while Lunr is beautiful.
Title: Re: Thinkbot
Post by: Zero on December 18, 2019, 09:45:32 AM
Arrrrgh, switching to lunr-mutable-indexes (https://github.com/hoelzro/lunr-mutable-indexes) because lunr 2.x index is immutable.  ;D
The lunr guy takes decisions, like... he knows what's good better than the library users do.

Back to work.



I need to think out loud now. Say, we're in the middle of a cycle. We just got a search running, and we have results like this JSON:
Code: [Select]
[
  {
    id: 'module1.f5',
    relation: 'EvaluationLink beautiful $X',
    score: 1.5308861812688752
  },
  {
    id: 'test.module2.f5',
    relation: 'EvaluationLink beautiful $X',
    score: 1.5308861812688752
  },
  {
    id: 'module1.f3',
    relation: 'EvaluationLink boring $X',
    score: 0.45325544674057694
  },
  {
    id: 'module1.f4',
    relation: 'EvaluationLink young $X',
    score: 0.45325544674057694
  },
  {
    id: 'test.module2.f3',
    relation: 'EvaluationLink boring $X',
    score: 0.45325544674057694
  },
  {
    id: 'test.module2.f4',
    relation: 'EvaluationLink young $X',
    score: 0.45325544674057694
  }
]

We have the scores and the relations. Now we want to know what to do next. The obvious idea is: pattern-match it to find the relevant piece of code you're gonna execute in front of this. But we don't want over-complicated pattern definition.

Seneca uses key-value patterns, like "role:math,cmd:sum". Here, we have lists, but these lists are ordered, which means they're like key-value pairs with keys being "first item, second item, ...".

A list like "ImplicationLink f2 f3" can be translated to
Code: [Select]
{
  "type": "ImplicationLink",
  "rest": "f2 f3",
  "i1": "f2",
  "i2": "f3"
}

which Seneca can handle. the "rest" key is here to reward "full hits" more than just the sum of partial matches.

That's a simple solution. However, maybe it lacks flexibility.

And it doesn't take multiple input into account anyway, with scores and all.



There's the other solution. If relations have fixed arity, for example, AndLink always have 2 arguments, then we can rewrite the search results as a list of trees, replacing ids by the relations they identify.

f1: ImplicationLink f2 f3
f2: AndLink f4 f5
f3: is $X boring
f4: is $X beautiful
f5: is $X young

gets resumed as ImplicationLink AndLink is $X beautiful is $X young is $X boring
We obtain prefix-notation code, which can be run through... a chatbot! Yep, again.

Maybe mixing the 2 solutions can bring out interesting possibilities. Chatbots are good at replying, so they could provide the next search query. And Seneca could provide local execution of thought.

Or... we can remove ambiguity by using opening/closing tags, like
ImplicationLink AndLink Is $X beautiful EndIs Is $X young EndIs EndAndLink Is $X boring EndIs EndImplicationLink
Title: Re: Thinkbot
Post by: Zero on December 18, 2019, 01:29:17 PM
- make a search
- get results
- make "overview sentence" out of results
- send overview sentence to rivescript
- rivescript renders preliminary query
- run seneca against results
- seneca microservices act
- with final query: loop
Title: Re: Thinkbot
Post by: Zero on December 18, 2019, 06:32:07 PM
All candy.

Listening to this: https://www.radio.fr/s/synthwaveretrowave (https://www.radio.fr/s/synthwaveretrowave)

Also, switching back to lunr, because mutable-lunr just rebuilds the index every now and then, which I can do by myself (and... lunr is beautiful while mutable-lunr is ugly). Rivescript brains would need to be rebuilt too, when the system learns something.

Learning is sooo overrated in AI world...

I do have my "overview function" now.

Code: [Select]
function overview(results) {
    var ref = {};
    results.forEach(result => { ref[result.id] = result; });
    results.forEach(result => {
        var takenTokens = [];
        var tokenCount = -1;
        result.expandedScore = result.score;   
        while (tokenCount != takenTokens.length) {
            tokenCount = takenTokens.length;
            result.relation = result.relation.split(' ');
            result.expandedRelation = result.relation.map(token => {
                if (ref[token]) {
                    if (!takenTokens.includes(token)) {
                        takenTokens.push(token);
                        result.expandedScore += ref[token].score;
                    }
                    return ref[token].relation;
                }
                else
                    return token;
            }).join(' ');
            result.relation = result.expandedRelation;
        }
    });
    return results;
}
It works. Going to plug Rivescript in.
Title: Re: Thinkbot
Post by: LOCKSUIT on December 18, 2019, 07:21:32 PM
where's the download button, for the song...

i think i found it, if not then it gone:
h ttps://www.youtube.com/watch?v=4rYfodqEF7E
h ttps://www.youtube.com/watch?v=7RK6mLL_gog
I think goaty will like the one above though hehe
I came across H.P. Lovecraft somewhere lol..................

It's gone dude....but I think I found it below let me see now.......hmm, nope
h ttps://www.youtube.com/watch?v=N6O1o3hGgtQ

EDITED
Title: Re: Thinkbot
Post by: Zero on December 18, 2019, 08:50:56 PM
here
Title: Re: Thinkbot
Post by: Zero on December 20, 2019, 12:43:18 PM
Data files now look something like:

# meta

author:   zero
date:     2019/12/16
keywords: eno test2 content

# data

f1: ImplicationLink, f2, f3
f2: AndLink, f4, f5
f3: EvaluationLink, boring, $X
f4: EvaluationLink, young, $X
f5: EvaluationLink, beautiful, $X

# graph

test1:
i = one, *, three
o = fruit 1

test2:
i = one, two
o = fruit 2

test3:
i = one, *
o = fruit 3

test2:
i = *, three
o = fruit 4


#data is for the search engine, #graph is for the graphmaster.
Title: Re: Thinkbot
Post by: Zero on December 20, 2019, 09:39:24 PM
I now have
- my home grown graphmaster,
- my mini search engine,
- a basic enodoc readers import.

I'm adding an observer (https://en.wikipedia.org/wiki/Observer_pattern). Various engines in the loop will register interest in read/write access to certain items in search index or graphmaster, and get activated when things happen.

The search object is really the swiss army knife here, it acts as main memory. Say, if core.ObjetType of eng2 is core.Engine, then search.neighbourhood(["eng2", "core.ObjectType"]) gives ["core.Engine"], while search.neighbourhood(["core.Engine", "core.ObjectType"]) gives ["eng1","eng2"].

What's more powerful than graphmaster + inverted index + observer pattern ...?

Edit: yeah, beowulf  ;)
Title: Re: Thinkbot
Post by: Zero on December 21, 2019, 10:13:10 AM
Ivan, how do you approach uncertainty in logic?
Title: Re: Thinkbot
Post by: ivan.moony on December 21, 2019, 10:53:56 AM
Ivan, how do you approach uncertainty in logic?

I'm glad you asked, that is an interesting topic. See autoepistemic logic (https://en.m.wikipedia.org/wiki/Autoepistemic_logic) and negation as a failure (https://en.m.wikipedia.org/wiki/Negation_as_failure). I try to simulate it with complements. When written `(Ac) -> X`, `X` will be derived if `A`can't be derived (is not certain). That's the starting construct. I further complicate it by introducing `syntax` and `semantics` definitions, and I write: if complement of top grammar symbol is derived, then `Wrong` is derived as a failure. But this requires asserting duals to implications on each regular implication, so each `A -> B` is paired with `Bc -> Ac`. I'm still having issues with this approach.

Note that complement is not the same as negation. Negation of A is total opposite of A (¬A should be explicitly stated to hold), while complement of A is anything but A (Ac holds when A is not stated).

I think it's about how logic treats expressions. In pure logic we can calculate if some expressions is always true, or always false. But uncertainity involves cases when a formula is merely satisfiable (may be true, may be false).

OpenCog has wired in uncertainty by noting a decimal between 0 and 1 on each starting formula. PLN then calculates those values for inferred formulas.
Title: Re: Thinkbot
Post by: LOCKSUIT on December 21, 2019, 11:46:16 AM
https://medium.com/datadriveninvestor/uncertainty-in-machine-learning-predictions-fead32abf717

When you give an ex. network some big diverse data of words, it can learn unsupervised the relations cat=dog. And how much boat=meow. Uncertainty is when you have low data on some specific topic or you do have lots but they counter each other ex. my meow, my boat, his meow, his boat, great now w2v thinks boat=meow! Or you show it a 7 but it looks like a 1 and it activates both up as much and, if your brain quantinizes w2v, you may have a 0 difference ex. not =1 0.2624% =7 0.2637% but instead all you know is =1 0.2% =7 0.2%! In such case you go with best choice or, a guess (or think it is both a 1 or 7). But in a thinking brain, you can ask Master for new data or go another route (and, generate your own data at the same time) if get stumped on how to invent better HDDs.

So:
1) big diverse data
2) low quantinization
3) go with one or both possibilities to see what happens next
4) go another route + generate your own data and ask/search for new data
Title: Re: Thinkbot
Post by: Zero on December 21, 2019, 02:38:31 PM
Thank you for your quick answers. Honestly, I'm not intelligent enough to understand clearly everything you said, Ivan. I read carefully Wikipedia's articles you mentioned.

I noticed how Opencog uses PLN, but I don't understand how confidence can be other than crispy. To me, either the program knows something (because it's inside of itself), or the program believes something (because it's outside of itself), in which case it's directly a probability, without fractional uncertainty. Subjectivity is one component of probability, like any other component it doesn't deserve any special handling.

Also, I'm interested in multi-valued logic (https://en.wikipedia.org/wiki/Many-valued_logic). For example, I find it nice to imagine:
- True,
- False,
- Both true and false,
- Neither true nor false,
- Currently unknown,
- Meaningless.
Title: Re: Thinkbot
Post by: Zero on December 21, 2019, 03:07:45 PM
Hey, check this out:
https://en.wikipedia.org/wiki/Jaina_seven-valued_logic (https://en.wikipedia.org/wiki/Jaina_seven-valued_logic)
Title: Re: Thinkbot
Post by: Zero on December 21, 2019, 04:13:39 PM
Maybe adding "irrelevant", to handle the frame problem.

- True,
- False,
- Both true and false,
- Neither true nor false,
- Unknown currently,
- Meaningless,
- Irrelevant.
Title: Re: Thinkbot
Post by: Zero on December 21, 2019, 05:09:46 PM
Quote
Note that complement is not the same as negation. Negation of A is total opposite of A (¬A should be explicitly stated to hold), while complement of A is anything but A (Ac holds when A is not stated).

When you say " Ac ", does it mean the same as " ¬◻A "?

The words "anything but A" are confusing me. Does it mean "some statement, which is not related to A"?
Title: Re: Thinkbot
Post by: ivan.moony on December 21, 2019, 05:29:10 PM
Quote
Note that complement is not the same as negation. Negation of A is total opposite of A (¬A should be explicitly stated to hold), while complement of A is anything but A (Ac holds when A is not stated).

When you say " Ac ", does it mean the same as " ¬◻A "?

The words "anything but A" are confusing me. Does it mean "some statement, which is not related to A"?


Almost. I compare expressions like `(~ A) -> B` with every other expression and attach `B` wherever `~ A` matches. And `~ A` matches any statement which differs from A and from which A does not follow.

But don't bother too much, I'm still working it out. The best working thing for now is "negation as a failure" from Prolog. (i.e. `not A` is true if we can't derive `A` from anything else).
Title: Re: Thinkbot
Post by: Zero on December 21, 2019, 05:54:39 PM
Ok thanks. I'll dig into NAF.

Would you say crispy confidence is enough for GOFAI? Ok that's not the right word, would you say it's enough for a toy project?
Title: Re: Thinkbot
Post by: ivan.moony on December 21, 2019, 06:32:41 PM
Ok thanks. I'll dig into NAF.

Would you say crispy confidence is enough for GOFAI? Ok that's not the right word, would you say it's enough for a toy project?

I bet it's enough for a core in which analogical confidence may be formulated.
Title: Re: Thinkbot
Post by: goaty on December 22, 2019, 03:02:27 PM
How can something be both true and false at the same time?  Its either one or the other.
Title: Re: Thinkbot
Post by: LOCKSUIT on December 22, 2019, 03:31:04 PM
@Goaty, Or better, how does the human brain store True to begin with. All I store is data; images and audio. Your majority context vote decides what is aligned. Some memory nodes in your network trigger Reward seduction and create your values and what you take way after reading an article.
Title: Re: Thinkbot
Post by: goaty on December 22, 2019, 10:59:14 PM
@Goaty, Or better, how does the human brain store True to begin with. All I store is data; images and audio. Your majority context vote decides what is aligned. Some memory nodes in your network trigger Reward seduction and create your values and what you take way after reading an article.

U may be right about that,  but there is many ways to do artificial intelligence, and all ways could be different ways to skin a cat.
Title: Re: Thinkbot
Post by: Zero on December 23, 2019, 02:42:32 PM
"AGI is a good thing" is both true and false.
"Justice is violet" is neither true nor false.
"I'll succeed" is currently unknown.
"Some people like it, some people don't" is irrelevant.
"Rrnak" is meaningless. I guess.
Title: Re: Thinkbot
Post by: Korrelan on December 23, 2019, 03:03:54 PM
@Goaty

Quote
How can something be both true and false at the same time?  Its either one or the other.

It’s always true that something is false.

@Lock

Quote
how does the human brain store True to begin with. All I store is data; images and audio.

Your brain stores everything, true, false, good, bad it has too… you can’t know one without understanding the other/ opposite.  You learn what’s true.

@Zero

Quote
"Justice is violet" is neither true nor false.

Everything is subjective... It’s false to me… I’m R/G colour blind.  ;D

 :)
Title: Re: Thinkbot
Post by: LOCKSUIT on December 24, 2019, 12:31:15 AM
"AGI is a good thing" is both true and false.
"Justice is violet" is neither true nor false.
"I'll succeed" is currently unknown.
"Some people like it, some people don't" is irrelevant.
"Rrnak" is meaningless. I guess.

You can go on and on, value, brightness, glossiness, shape, color, good, rotten, sad, drinks liquid, animal. They describe each other, all words in a dictionary do this, and it is same for real world. It's a small world network.
Title: Re: Thinkbot
Post by: Hopefully Something on December 24, 2019, 06:07:49 AM
Quote
You can go on and on, value, brightness, glossiness, shape, color, good, rotten, sad, drinks liquid, animal. They describe each other, all words in a dictionary do this, and it is same for real world. It's a small world network.

Have you made a detailed drawing or diagram of this? That might be interesting.
Title: Re: Thinkbot
Post by: goaty on December 24, 2019, 07:41:02 AM
"AGI is a good thing" is both true and false.

I spose your right,  theres not enough context there to label it with an explicit/definite true xor false yet, so it could be both at that stage, like a qbit.  true and false at the same time.
Title: Re: Thinkbot
Post by: WriterOfMinds on December 24, 2019, 04:46:30 PM
Quote
"AGI is a good thing" is both true and false.

I don't think so.  It would be accurate to say "AGI has both good and bad aspects."  However, considering all the aspects in aggregate, it would still be possible to arrive at an overall rating of good or not good -- to determine whether AGI was a net benefit for life, or not.  If we don't have adequate knowledge and wisdom to derive that rating, or if there is dispute about it due to differences of opinion, then the statement is "unknown" rather than "both true and false."
Title: Re: Thinkbot
Post by: Zero on December 24, 2019, 07:46:49 PM
IMO, always forcing calculation of an overall rating would be a mistake, because that's cold machine thinking. Sometimes, to me, things are just both good and bad. Dilemma shouldn't be wiped out of the equation like that, if we don't want to loose the "heart" side of subjectivity.
Title: Re: Thinkbot
Post by: LOCKSUIT on December 25, 2019, 05:41:31 PM
Yeah haha, good stuff. Checking the new posts now.
Title: Re: Thinkbot
Post by: LOCKSUIT on December 25, 2019, 06:01:18 PM
For Christmas you will get something today actually. Hold on.

The graph you mention sounds similar to mine you'll see soon, do you have a viz? Or can explain its purpose/what it'd would look like if had a viz? I like viz.
Title: Re: Thinkbot
Post by: Zero on December 25, 2019, 07:02:13 PM
what's your goal lock?
Title: Re: Thinkbot
Post by: LOCKSUIT on December 25, 2019, 07:13:15 PM
AGI, immortality, and women (a huge family of wives in a happy utopia, one big family aligned like magnetic domains/hierarchy) ....among other things, video games, cupcakes, fries, empty homes freshly built, huge palaces, simulators, unseen data, related data, averages etc
Title: Re: Thinkbot
Post by: Art on December 25, 2019, 07:22:06 PM
still readin lock?

Zero,

Two of your posts have been removed in violation of our T.O.S. with regard to content and language.

I trust there will not be a third.

Thank you and Merry Christmas!
Title: Re: Thinkbot
Post by: Zero on December 25, 2019, 07:35:40 PM
Good, moderation is working fine. There won't be a third. Thank you Art.
Title: Re: Thinkbot
Post by: Zero on January 01, 2020, 03:51:42 AM
that's official now, my wife is leaving me or breaking whatever you call it in english.
Title: Re: Thinkbot
Post by: Hopefully Something on January 01, 2020, 07:28:17 AM
Divorce settlements tend to suck. Still, what's more important, material possessions or self worth? When I'm in unpleasant situations I've learned that I feel a lot better If I make the effort (sometimes supreme effort) to end it on a good note. The feeling of having done something worthwhile vs regret makes an immeasurable difference afterwards. Sorry if this is unsolicited advice, didn't want to say nothing though either, were're helping each other build AI after all. :)
Title: Re: Thinkbot
Post by: Zero on January 01, 2020, 10:50:43 AM
thanks
Title: Re: Thinkbot
Post by: Korrelan on January 01, 2020, 11:55:31 AM
You posted on a public forum so I presume you require some 'old man' advice.

The human brain has many failings, not least of which is its inability to resolve/ predict a positive outcome from a negative experience.  The main culprit for this phenomenon is our innate preferred method of learning from personal experience. When we encounter life experiences that we have no previous personal experience of, the lack of knowledge/ understanding can be translated/ reflected as negative thoughts/ emotions. Human psyches tend to lean towards the pessimistic side of the emotional spectrum; it’s the fear of the unknown quantity that drives these emotions, keep them in check with common sense/ reasoning. 

I’m personally on my third (and by far best) marriage, and whilst I wouldn't take my advice on keeping a woman happy, I will say that although the experience is going to be painful and traumatic keep a level head and be amicable, especially if kids are involved, this is not their fault.

However, once the air has cleared your main consideration should be yourself, take time to get your life back in order, do the things that you want to do and re-build your own sense of singledom… learn from your mistakes and improve.

It works both ways, happiness is also relative to experience, your current idea of happiness may not be the optimum experience, you don't realise this yet because you've not experienced it.

Although the tunnel is long and dark there is always a brighter light at the end of it.

 :)
Title: Re: Thinkbot
Post by: Zero on January 01, 2020, 01:33:55 PM
I can't thank you enough.
thank you both, and everyone else here too.
Title: Re: Thinkbot
Post by: WriterOfMinds on January 01, 2020, 07:12:49 PM
That's rough. Good luck.
Title: Re: Thinkbot
Post by: Freddy on January 01, 2020, 07:40:16 PM
Stay strong Zero. Not the best start to a new year, but I am sure you will see the light at the end of the tunnel soon and be stronger for it :)
Title: Re: Thinkbot
Post by: ivan.moony on January 02, 2020, 11:34:05 AM
When I'm in a bad mood, I try not to think about myself. I try to see whoever is doing worse than me, and I try to help. It doesn't need to be anything big, but trying to do something good usually lifts me up from being depressed. If I, for instance, cache in a dine or two for some charity organization, I may find myself useful and feel worth of living. I don't know why, but it helps me clear up my head from bad thoughts.

https://www.youtube.com/watch?v=bO2xMNU9bTw (https://www.youtube.com/watch?v=bO2xMNU9bTw)

... I guess it's a solid ground for me where I once again remember who I really want to be.