Logo by kr0mat1k - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. April 20, 2024, 03:19:42 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Genetic Programming to find the 3D brot  (Read 4746 times)
0 Members and 1 Guest are viewing this topic.
twinbee
Fractal Fertilizer
*****
Posts: 383



WWW
« on: September 04, 2010, 10:44:41 PM »

It's an idea I've had for a while, since finding the holy grail via other means is turning out to be a difficult challenge. Why not 'cheat' to find the Mandalisk?

In reality of course, this is going to be one incredibly difficult challenge in itself. I've had a little experience with genetic algorithms, but GP I need to look into.

That's the easy part.

The fitness function for this is going to be something straight from hell. Even with infinite CPU speed, I'm expecting a giant monolithic function that's very hard to test. Obviously, one would start out experimenting with a 2D version, which itself would be something of a nightmare - we'd want to check for circles surrounding circles, but where a higher fitness is given to particular patterns of circles which more closely resemble the character of the original Mandelbrot. The rough shape isn't what we're looking for, it's the concept of fractal circles surrounding each other.

In the picture below, take a look at A and B. We'll want very high fitness scores for those, but for diagram C, we'd still want a fairly high score, even though some circles are overlapping, disconnected, or are more like blobs than circles.

So if the 2D version is hard enough, the 3D version (testing for spheres surrounding spheres) will be a nightmarish affair, conceptually and in terms of CPU efficiency. It will be so difficult that I've even thought about evolving the fitness function itself.

What do others think - is this an idea with any merit?


* mandelbulb-dp.png (42.42 KB, 554x418 - viewed 412 times.)
« Last Edit: September 04, 2010, 11:07:16 PM by twinbee » Logged
msltoe
Iterator
*
Posts: 187


« Reply #1 on: September 04, 2010, 11:27:02 PM »

twinbee,

I've thought about this too. It would sure save time.
For a fitness function it could be just a human who rates the quality of the different shapes being generated. Of course, a filter function could be used to throw out obvious "no go's." If the GP could find new wonders besides the Mandelisk, that would be good, too. The Mandelbox is the best example of a new shape that was not Mandelisk-like but turned out to be very interesting to explore.

-mike

P.S. Picture A looks a lot like the snowflake brot I found: http://www.fractalforums.com/theory/juliabulb-with-'octahedral'-transform-~-sphereflake/
Logged
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #2 on: September 05, 2010, 12:12:45 AM »

I'm not sure exactly what you mean by the Mandalisk, but it sounds like you are pursuing the 3d Mandelbrot?  (Mandalisk sounds cool)....

  Anyways, I pretty much think it's already been found....  and it's just the bulb (although specific varieties are "more correct").  There is great variety for even the z^2 bulb (this is a complex compound version, faster run times, just uses 2 complex variables instead of one, it's easy to see the mathematical relationship to the 2d version):


check out other images here

  You just have to color it correctly, first attached file has a coloring formula for ChaosPro.  Might want to try it with the benesi set simplified formulas for the complex compound coloring scheme.  Try the 5d set complex compound with colormode=complex 3 (or other) and r2mode= r2 mode 1 for an interesting looking thing.  5d Mandelbulb is not implemented in the 5d set yet....   Rename the formulas by removing the .txt extension then drop 'em in your ChaosPro formula directory (folder).

* Benesi Coloring.ccl.txt (11.44 KB - downloaded 147 times.)
* Benesi Coloring.ccl.txt (11.44 KB - downloaded 142 times.)
* benesi set simplified.cfm.txt (86.87 KB - downloaded 180 times.)
Logged

kram1032
Fractal Senior
******
Posts: 1863


« Reply #3 on: September 05, 2010, 07:03:34 PM »

Genetic programming to find the mandelbrot? Awesome idea cheesy
However, I guess the only true fittness function that will work will be the actual human perception. And that's hard for several reasons:

- Highly subjective
- limited to 2D projections/cutthroughs, except you build a dynamic hologram on the fly (would be incredible aweseome cheesy But I guess, beyond all real possiblity...)
- no way, you could examine big parts of the sphere mass with zooms to know if it's close or not in the details in any short time, and
- even if you only go for the overall shape: It's SlOOOOW and tedious.
(The human perception fittness curve algorithm will not be exponential, but the slow, semi-chemical computing implementation will make it look like that.)

What *might* be possible, is to use a generic fitness function that at first just randomly throws out examples and you can see both the taken and then thrown-away ones.
Then, you basically rank the outputs without even knowing, which the fitness function had chosen. And based on that, it tries to become more and more confident with its picks. After some time (maybe some tenthousand images or so), it will be nearly confident enough to make its own picks.

Doing it first for a 2D set will be crucial, I guess, to at least be able to hope for any sign of covergence smiley

So basically a fitnessfunction that is you, which controlls a fitnessfunction that changes itself based on genetic algoritms, which then controls the actual fractal/approximation of a fractal.
Logged
twinbee
Fractal Fertilizer
*****
Posts: 383



WWW
« Reply #4 on: September 06, 2010, 01:21:47 AM »

Yes, using a human to assess the fitness function sounds good - I forgot about that idea from before. There was even an article from Slashdot about a website with an applet that evolved a function to create pictures that people thought looked 'good'. Same principle here. And yep, we can discover unseen shapes!

The only problem is that if we ever find it, the math could quite easily cover a few pages if we let this thing run havoc! smiley

Quote
P.S. Picture A looks a lot like the snowflake brot I found: http://www.fractalforums.com/theory/juliabulb-with-'octahedral'-transform-~-sphereflake/

Heh, yep. Also like this:
http://img383.imageshack.us/img383/893/sphereflake02hd3.jpg

Quote
I'm not sure exactly what you mean by the Mandalisk, but it sounds like you are pursuing the 3d Mandelbrot?

Yep, just another name for it, since Mandelbulb has been used up already wink

I'll have to create an artist's impression of what I think a zoom-in will look like sometime. It'll be 10x weirder than one can imagine though.

Quote
However, I guess the only true fittness function that will work will be the actual human perception. And that's hard for several reasons:

- Highly subjective

We'll be looking out for anything resembling spheres surrounding spheres and recursive definitions thereof. Maybe a 3D cardioid too.

Quote
limited to 2D projections/cutthroughs,

Well, a light-sourced 3D shaded render will give a pretty good idea of what it should look like. No real need for cutthroughs imo, though that could help I guess in the assessment.

Quote
- even if you only go for the overall shape: It's SlOOOOW and tedious.

Not with a GPU wink

Quote
(The human perception fittness curve algorithm will not be exponential, but the slow, semi-chemical computing implementation will make it look like that.)

I'm unsure how many generations would be required to make it look good. So yeah, there's a chance that we still may need to define a fitness function for speed.


Quote
Then, you basically rank the outputs without even knowing, which the fitness function had chosen. And based on that, it tries to become more and more confident with its picks. After some time (maybe some tenthousand images or so), it will be nearly confident enough to make its own picks.

So that's essentially evolving the fitness function I think...

Quote
Doing it first for a 2D set will be crucial, I guess, to at least be able to hope for any sign of covergence

Yes using the 2D Mandelbrot as a testing ground would be helpful. We'd start out with nothing, or maybe with the Mandelbrot template but without the rotation function, and work from there.

I was actually thinking of only evolving the rotation function for when we try to evolve the Mandalisk (so the rest of the Mandelbrot-esque code is already in place).

Quote
So basically a fitnessfunction that is you, which controlls a fitnessfunction that changes itself based on genetic algoritms, which then controls the actual fractal/approximation of a fractal.

Grand cheesy That itself could be recursive, a fitness function which helps define a fitness function which controls a fitness function etc. (head explodes).
« Last Edit: September 06, 2010, 01:56:54 AM by twinbee » Logged
kram1032
Fractal Senior
******
Posts: 1863


« Reply #5 on: September 06, 2010, 11:45:05 PM »

I always wanted to program a fittnessfunction for a generic world cheesy (Not that I have the actual skills for that^^)
Like actual real evolution: Some small goals are tried to be fullfilled:
-get food
-reproduce
-survive
What is considered as food doesn't matter. It should be kept generic. How awesome would be a computer game, where you don't only have your average villian and NPCs but next to that actual evolving species which just try to survive - and might happen to think of you as food on the way...
They'd try to learn and get your tactics down and finally they'd be the way more dangerous threat than your main villian. Therefore, they also harm him, as they're totally neutral smiley

Ok, way offtopic for the Mandelisk part but that'd probably need just such a recursive fitness function.

Or maybe an operating system (emulated of course, so that it doesn't destroy anything from your true OS^^) that starts out as tinyOS + genetic algorithm and tries to improve itself, based on what you do and on bugs that are randomly caused. When ever something bad happens, you say "BAD SYSTEM!" or "DARN BUG!" and when something good happens, you say "good system *pat*" - might be tedious but in theory, after some time you have a very nice custom system that works just as you need it, lol.
Logged
KRAFTWERK
Global Moderator
Fractal Senior
******
Posts: 1439


Virtual Surreality


WWW
« Reply #6 on: September 07, 2010, 12:56:00 PM »

I love this!  afro

What about the "MandelGrail"   hurt
Logged

Softology
Conqueror
*******
Posts: 120


« Reply #7 on: September 12, 2010, 07:46:47 AM »

I considered this myself early when the first variations of the Mandelbulb cropped up.

The selection method can be the human user.  You generate (for example) a grid of 12 or so triplex fractal images.  The human clicks which of them they think are good candidates and then clicks a evolve button.  The program then generates maybe 4 new random images, 4 mutated images (take the current "gene pool" formulas and mutate them slightly) and 4 bred images (take formulas from the gene pool and cross breed etc).  Repeat until something new/pleasing appears.  This saves you trying to write complex code to get the computer to determine what is a good image.

I have done a lot of this with 2D images and the results are promising.  If I had the time and patience to write a formula parser for triplex algebra I would give it a go for sure.

Here is a quick PDF overview of the genetic methods I have experimented with over the years for 2D images.
http://softology.com.au/geneticart.zip
Extending to 3D would be awesome.

Jason.
Logged
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #8 on: September 13, 2010, 02:23:50 AM »

  Jason,

  You don't need anything too complex to do triplex "algebra".  You simply require:

A) a square root function to calculate a magnitude:
  r1= sqrt(y^2+z^2)

B) a complex power function:
  complex_1= (x + i r1)^n
  complex_2= (y + i z)^n

C) a real power function:
  r3=r1^-n       (you are applying the magnitude of y and z two times (once in each complex number), so need to divide it out once)

D) the ability to directly access the real and imaginary components of the complex numbers:
  new x = real part of complex 1   + x pixel value  OR  x Julia seed   (for Julias use the seed, Mandys use the pixel value)
  new y = imaginary part of complex_1 * real part of complex 2 * r3  + y pixel value  OR  y Julia seed
  new z = imaginary part of complex_1 * imaginary part of complex 2 * r3  + z pixel value  OR  z Julia seed

  No trig required....  and the non trig version is faster computationally than calculating arg/atan2, cos, sin, etc.  Not to mention it's easier to see how to extend this to higher dimensions: each dimension gets another complex component...
Logged

cortexman
Guest
« Reply #9 on: October 03, 2010, 12:12:44 AM »

You should start with simple fitness functions and then slowly make them more complex as needed.

Rather than relying on perceptual fitness functions I suggest you come up with some relatively simple heuristics.

For instance, can you use the fractal dimension? I read on these forums that you could estimate it for a given brot using a box counting technique.
Logged
Power 8
Conqueror
*******
Posts: 147



WWW
« Reply #10 on: October 03, 2010, 01:40:27 AM »

Very interesting idea using genetics...

There's a guy called William Latham who worked on evolutionary 3D shapes in the 80s and 90s.
 Not necessarily fractal images, but a similar line of thought as in this thread. Maybe you guys know about his work.
If you don't here's a link to a page on his website, with the human as a "gardener" choosing which are "good" and "bad" shapes:
http://www.doc.gold.ac.uk/~mas01whl/themes/gardener.htm

There are also other interesting images and videos on his website.


Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
How to find the chosen parameter point General Discussion gamma 0 1211 Last post October 07, 2008, 11:42:50 AM
by gamma
CUDA Programming with Ruby Programming ker2x 1 3146 Last post September 28, 2010, 09:55:46 PM
by ker2x
Sharing knowledge about SSE programming - possibly running a forum? Let's collaborate on something! cbuchner1 10 5676 Last post August 13, 2011, 07:57:25 AM
by panzerboy
Genetic accident Mandelbulb3D Gallery bib 0 617 Last post February 25, 2012, 11:24:46 PM
by bib
Genetic rebirth Mandelbulb3D Gallery bib 0 578 Last post February 26, 2012, 11:51:38 AM
by bib

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.179 seconds with 26 queries. (Pretty URLs adds 0.008s, 2q)