Simple genetic algorithm idea

  • 11 Replies
  • 6076 Views
*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Simple genetic algorithm idea
« on: March 18, 2015, 08:32:08 pm »
Today I thought of a simple way of how to implement genetic algorithm. I'll need it for new formula generation. The idea is to randomly generate left and right side, then to check do they yield the same result with the same input variables. If they do, we put equal sign between them and there is a new furmula. To do this, we need to systematically generate possible candidates for left and right side.


The first thought I had was to cycle combinations of expressions like in following example (if we have expressions e1, e2 and e3 and super-expression that holds these 3):


e1,e1,e1
e1,e1,e2
e1,e1,e3
e1,e2,e1
e1,e2,e2
e1,e2,e3
e1,e3,e1
e1,e3,e2
...


This is easy, but it gets complicated to track combinations with multiple level expression depth and recursion. The genetic algorithm would be in that we first try combinations of those expressions which was more successful in finding new formulas (i.e. when a new formula is found to be true, expressions that built it get indexed up in future expression picking order).


Simpler way would be by utilizing random numbers, so the pattern of upper noted expression would be:



e1 if random(percent of e1) | e2 if random(percent of e2) | e3 if random(pecent of e3),

e1 if random(percent of e1) | e2 if random(percent of e2) | e3 if random(pecent of e3),

e1 if random(percent of e1) | e2 if random(percent of e2) | e3 if random(pecent of e3)


With each call we would get a randomly generated triple of expressions without need to track each combination and to cycle through all possible combination. We just pass percents of success (the more the percent is, the more possibility of picking that option) and each time we get a different randomly generated expression (well, it is possible to get the same expression twice or more times, but those are solvable details).


I think that random-approach is a lot simpler than cycling through all possible combinations. More, imagine if we had multiple levels of expressions with recursions and stuff. All that is solved easily with random-approach.


I just wanted to share this with you, such an complex combinatorial task, yet so easily solved with random expression picking.
 :transformer:

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Simple genetic algorithm idea
« Reply #1 on: March 19, 2015, 03:19:31 pm »
This is basically how an art could be artificially generated. You have to supply computer with i.e. valid English grammar and computer fires up random sentences. If we could steer those sentences to match some semi-planned result, we could have a machine - novel writer.

*

ranch vermin

  • Not much time left.
  • Terminator
  • *********
  • 947
  • Its nearly time!
Re: Simple genetic algorithm idea
« Reply #2 on: March 19, 2015, 06:30:39 pm »
I dont get it,  why would you need 2 equations that yeild the same result, why wouldnt you just need one of them?

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Simple genetic algorithm idea
« Reply #3 on: March 19, 2015, 07:11:23 pm »
I dont get it,  why would you need 2 equations that yeild the same result, why wouldnt you just need one of them?

Actually it is two expressions in one equation, not two equations. I.e. one generated expression would be:
Code
A or B
and second:
Code
not ((not A) and (not B))

If the result in all cases for A and B, in the both expressions is the same, we can memorize equation:
Code
(A or B) <-> not ((not A) and (not B))

We can extrapolate  this to another example:
Code
seagull is bird
swan is bird
seagull has wings
swan has wings

If we imagine these two: "X has wings" and "X is bird", we can easily calculate that both hold for each example, thus:
Code
(X has wings) <-> (X is bird)

Voilé, also two expressions to check. I think it is all about comparing two expressions, and by comparing two by two we can get any count. When a match is found, we can use the "<->" operator to note the new discovery.
« Last Edit: March 19, 2015, 07:35:15 pm by ivan.moony »

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Simple genetic algorithm idea
« Reply #4 on: March 19, 2015, 07:39:17 pm »
Please note that induction explained in my last post is not the same as genetic algorithm. Induction could use expressions built by a genetic algorithm.

Edit: And genetic algorithm could use the number of successful matches of induction as a reference for where to focus future generated expressions.
« Last Edit: March 19, 2015, 08:07:32 pm by ivan.moony »

*

Korrelan

  • Trusty Member
  • ***********
  • Eve
  • *
  • 1454
  • Look into my eyes! WOAH!
    • YouTube
Re: Simple genetic algorithm idea
« Reply #5 on: March 19, 2015, 11:14:29 pm »
If I understand correctly...

Cool idea but... Choosing the formula to be checked at random is no different to cycling through all possible combinations, if you are wanting to cover all possible permutations. The total possible number of combinations is the same, plus the extra time for duplicate checking.  I think you are just as likely to come across x+y <-> y+x either way. Once a expression/ formula has been discovered, indexing or moving to the top of the stack should be easy, kin to implementing a genetic algorithm.
It thunk... therefore it is!...    /    Project Page    /    KorrTecx Website

*

ranch vermin

  • Not much time left.
  • Terminator
  • *********
  • 947
  • Its nearly time!
Re: Simple genetic algorithm idea
« Reply #6 on: March 20, 2015, 05:04:34 am »
I thought this alot,  and I actually am even trying to do automatic extraction of symbols myself.

But just to you->
how are you going to extract these 'variables' from the sensor?
How did you know a seagulls wings are the same as a penguins wings.

Im sorry I dont understand the point of your idea, because ive put thought into this myself and came out with no cigar.

I dont see how the algorythm could be validated without knowing what the data was to begin with.   If there was anything generated from the genetic algorythm, unfortunately this extra information isnt possible to be assessed, judged, as correct or incorrect.

Only waiting till if it arised in the sensor, could you know if it was correct,  and by then its too late, it could have been assigned already by something that wasnt randomizing itself.   Anything that was used before judgement, is nothing but a noisy fantasy from the machine.

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Simple genetic algorithm idea
« Reply #7 on: March 20, 2015, 08:02:25 am »
Quote from: ranch vermin
I thought this alot,  and I actually am even trying to do automatic extraction of symbols myself.
Depending on  your requirements, you would need a description language first. I'll use this one: parser.moonyweb.com

Quote from: ranch vermin
how are you going to extract these 'variables' from the sensor?
In advance I would put paths to symbols that would be considered as variables.

Quote from: ranch vermin
How did you know a seagulls wings are the same as a penguins wings.
nohow

Quote from: ranch vermin
Im sorry I dont understand the point of your idea, because ive put thought into this myself and came out with no cigar.
The point is finding new rules that hold on experimental data.

Quote from: ranch vermin
I dont see how the algorythm could be validated without knowing what the data was to begin with.   If there was anything generated from the genetic algorythm, unfortunately this extra information isnt possible to be assessed, judged, as correct or incorrect.
Beside grammar you would need a way to explicitly assert work data (examplars) before running inductor. This data would be after checked with inductor. When a new rule is found, it holds until a data that does not fit into that rule shows up.

Induction is a complex matter and I've tried to roughly explain it in paper already published here. Note the version of Synth in this paper (it is 0.1. The newest version is 0.3, but it isn't explained yet on the paper, just in my mind (I thought to program it first). In version 0.3 mostly there are cosmetic changes, but there are behavior difference too).

*

ranch vermin

  • Not much time left.
  • Terminator
  • *********
  • 947
  • Its nearly time!
Re: Simple genetic algorithm idea
« Reply #8 on: March 20, 2015, 05:31:14 pm »
If you fully believe in the idea, definitely implement it,  it might work,  I wouldnt know for sure.    Just I thought about logic paradigm and GA's before and I couldnt really think how they could possibly be validated, other than given the exact answer to the question in the first place,  defeating the purpose of having it.

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Simple genetic algorithm idea
« Reply #9 on: April 07, 2015, 11:24:02 pm »
After a bit of thinking I realized that I should clearly differ guessing from checking and induction.

Guessing can be done with genetic algorithm or by generalization from an example (not explained in this thread, but this is really intuitive).

Checking is done by induction as far as I'm concerned, by comparing one by one example until we check it all.

Some say that induction is actually something else: if two happenings always come together they are in condition-consequence relation. But I think that that is also guess-check cycle: we guess (either from examples, either by genetic algorithm) two happenings from a palette and then check (by induction) whether they always come together.

(Now becomes interesting) this together-thing works in a following way:
We conclude:
Code
A -> B
- if B is always there when A is there.
- which means that A can not be there without B

We conclude:
Code
A <-> B
- if B is always there when A is there and A is always there when B is there.
- which means that A can not be there without B and other way around

This is a way to form conditions and consequences from a list of plain data (maybe from a stream from input sensors). I believe they call all of this as induction, but I'd rather split it to guess and check steps.

*

ranch vermin

  • Not much time left.
  • Terminator
  • *********
  • 947
  • Its nearly time!
Re: Simple genetic algorithm idea
« Reply #10 on: April 15, 2015, 09:08:36 am »
but what new have you discovered?

and I said, its impossible.  its not how machines work,  machines dont think, they can only be programmed,  simple shit.  ai or no ai, so if you try to come up with something that isnt in the dataset, then its just random bullshit that makes no sense, and is completely nonvalidatable, until the point where you would have known it without the genetic algorythm.

PS
But you did say, generalization,  and i think that would work, but it requires no genetic algorythm, hence me not thinking of it.

PS
i could be wrong, hence me telling you if you know something I dont, dont believe my bullshit.

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Simple genetic algorithm idea
« Reply #11 on: April 15, 2015, 01:18:57 pm »
Let's say we have a formula over boolean a:
Code
not(not(a)) -> a
How did we get to that formula? We imagined it first with some kind of genetic algorithm in our mind. Then we checked every possibility to find out if the formula holds. i.e:
Code
not(not(true)) -> true
not(not(false)) -> false
and we concluded that the formula is valid

Genetic algorithm is about imagination. Generalization is also, but it's different from pure genetic imagination that attaches no bounds to imaginable particles. I think that genetic algorithm is more creative than generalization.

 


Requirements for functional equivalence to conscious processing?
by DaltonG (General AI Discussion)
November 19, 2024, 11:56:05 am
Will LLMs ever learn what is ... is?
by HS (Future of AI)
November 10, 2024, 06:28:10 pm
Who's the AI?
by frankinstien (Future of AI)
November 04, 2024, 05:45:05 am
Project Acuitas
by WriterOfMinds (General Project Discussion)
October 27, 2024, 09:17:10 pm
Ai improving AI
by infurl (AI Programming)
October 19, 2024, 03:43:29 am
Atronach's Eye
by WriterOfMinds (Home Made Robots)
October 13, 2024, 09:52:42 pm
Running local AI models
by spydaz (AI Programming)
October 07, 2024, 09:00:53 am
Hi IM BAA---AAACK!!
by MagnusWootton (Home Made Robots)
September 16, 2024, 09:49:10 pm
LLaMA2 Meta's chatbot released
by spydaz (AI News )
August 24, 2024, 02:58:36 pm
ollama and llama3
by spydaz (AI News )
August 24, 2024, 02:55:13 pm
AI controlled F-16, for real!
by frankinstien (AI News )
June 15, 2024, 05:40:28 am
Open AI GPT-4o - audio, vision, text combined reasoning
by MikeB (AI News )
May 14, 2024, 05:46:48 am
OpenAI Speech-to-Speech Reasoning Demo
by MikeB (AI News )
March 31, 2024, 01:00:53 pm
Say good-bye to GPUs...
by MikeB (AI News )
March 23, 2024, 09:23:52 am
Google Bard report
by ivan.moony (AI News )
February 14, 2024, 04:42:23 pm
Elon Musk's xAI Grok Chatbot
by MikeB (AI News )
December 11, 2023, 06:26:33 am

Users Online

328 Guests, 1 User
Users active in past 15 minutes:
squarebear
[Trusty Member]

Most Online Today: 497. Most Online Ever: 2369 (November 21, 2020, 04:08:13 pm)

Articles