• April 19, 2021, 09:18:36 PM

Login with username, password and session length

Author Topic: (Question) How to get second reference when using Perturbation Theory?  (Read 462 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr Rebooted

  • Fractal Phenom
  • ****
  • Posts: 55
(Question) How to get second reference when using Perturbation Theory?
« on: November 07, 2020, 04:23:16 AM »
I've Implemented Perturbation theory in my fractal explorer, UniFract II, although there's a few problems. For #1, It's the image attached below. You can compare it with the image below the image. Top is Perturbation disabled, Bottom is Perturbation enabled.

To fix this, how would I make another reference point? First reference is the center of the viewport (A.K.A. the offset)

Linkback: https://fractalforums.org/index.php?topic=3849.0

Offline Mr Rebooted

  • Fractal Phenom
  • ****
  • Posts: 55
Re: How to get second reference when using Perturbation Theory?
« Reply #1 on: November 07, 2020, 04:27:09 AM »
Second Image:

Offline pauldelbrot

  • 3f
  • ******
  • Posts: 2708
Re: How to get second reference when using Perturbation Theory?
« Reply #2 on: November 07, 2020, 05:58:20 AM »
The reference is escaping. Nanoscope's solution to this is to find blocks of pixels that have identical iteration counts down to the fractional part, which also catches most glitches. The largest connected component of the set of such pixels is found, then a pixel belonging to the block is found as near to its center of mass as possible, and then that pixel is calculated using normal arbitrary precision. That serves as the new reference (and also immediately does that one pixel). All other glitched/ref-escaped pixels are then recalculated using this reference. The test for such pixels is then repeated, and the whole procedure continues until they've all been corrected.

So-called "noisy glitches" are dealt with by detecting the loss of precision and bailing early, which results in the noisy glitch (and a perimeter around it) being turned into a "solid" glitch, which the above deals with.

Offline Mr Rebooted

  • Fractal Phenom
  • ****
  • Posts: 55
Re: How to get second reference when using Perturbation Theory?
« Reply #3 on: November 07, 2020, 06:08:02 AM »
So what your saying is that of the reference escapes, I need to set it back to what the reference's starting value was, right?

If not, how would I implement this by code in the fragment shader?

Offline Adam Majewski

  • Fractal Frogurt
  • ******
  • Posts: 467
Re: How to get second reference when using Perturbation Theory?
« Reply #4 on: November 07, 2020, 11:27:55 AM »
"noisy glitches" are dealt with by detecting the loss of precision and bailing early, which results in the noisy glitch (and a perimeter around it) being turned into a "solid" glitch, which the above deals with.

Is it oK ?

noisy glitches = isolated pixels

solid glitch= The largest connected component of the set of such pixels

https://en.wikibooks.org/wiki/Fractals/Image_noise#glitches



Offline gerrit

  • 3f
  • ******
  • Posts: 2402
Re: How to get second reference when using Perturbation Theory?
« Reply #5 on: November 07, 2020, 07:58:53 PM »
As far as I know nobody knows the best method to select the next reference point. Knighty's SMB which I think is still a bit faster than KF though being more of a testbed than a usable renderer puts the glitches in distinct sets (G1,.., Gn) with same iteration number where glitch was detected. Next references will then be 1 random pixel from each of the G1,..,Gn and is used only to recalculate the pixels in each set G. Secondary glitches simply generate another set G and you just put then in some queue or stack and keep going at it till no more G sets left. When dealing with glitched pixels you can use the same series expansion as a starting point.

I've experimented a lot with using non-escaping reference points (centers of minibrot or Misiurewicz points) so glitched never occur because reference does not escape but never found a reliable way to do that though it can be faster (fewer glitches).

Search for the SMB code which is easy to understand apparently, I can almost understand it.

Other methods of great ingenuity have been proposed, esp. one by Claude which allows you to not just start over after glitching but seamlessly continue with a new non-escaping reference, but it does not always work AFAIK.

It's been a while since I worked on this, if I garbled anything someone will hopefully correct me.

Offline claude

  • 3f
  • ******
  • Posts: 1833
    • mathr.co.uk
Re: How to get second reference when using Perturbation Theory?
« Reply #6 on: November 08, 2020, 11:56:31 AM »
glitched never occur because reference does not escape
There are two types (at least) of glitches:
1. Reference escapes early, this type can be avoided by picking a non-escaping reference
2. Too-different dynamics (detected easily by Pauldelbrot's heuristic, detected accurately by gerrit's backwards error analysis, think knighty had another method too)

Type 1 can be improved by picking a random glitched pixel as the new reference and retrying

Type 2 can sometimes be fixed by using pixel with minimum |z| at the glitch iteration (possibly using derivative for 1 step of Newton's method to make it closer to a miniset), but often picking a random pixel works just as well - the advantage for minimum |z| comes for Mandelbrot set where you don't need to restart iterations from the beginning because minisets are periodic through 0 and the period is the glitch iteration (I use this in my mandelbrot-perturbator thing)

KF uses an algorithm I don't really understand for finding the "glitch center" based on pixel regions, but also has options for random choice and minimum |z| (without the fancy stuff from mandelbrot-perturbator).

Offline Mr Rebooted

  • Fractal Phenom
  • ****
  • Posts: 55
Re: How to get second reference when using Perturbation Theory?
« Reply #7 on: November 09, 2020, 10:38:05 PM »
There are two types (at least) of glitches:
1. Reference escapes early, this type can be avoided by picking a non-escaping reference
2. Too-different dynamics (detected easily by Pauldelbrot's heuristic, detected accurately by gerrit's backwards error analysis, think knighty had another method too)

Type 1 can be improved by picking a random glitched pixel as the new reference and retrying

Type 2 can sometimes be fixed by using pixel with minimum |z| at the glitch iteration (possibly using derivative for 1 step of Newton's method to make it closer to a miniset), but often picking a random pixel works just as well - the advantage for minimum |z| comes for Mandelbrot set where you don't need to restart iterations from the beginning because minisets are periodic through 0 and the period is the glitch iteration (I use this in my mandelbrot-perturbator thing)

KF uses an algorithm I don't really understand for finding the "glitch center" based on pixel regions, but also has options for random choice and minimum |z| (without the fancy stuff from mandelbrot-perturbator).

 By code, how would I find a random gliched pixel? (Sorry I'm a beginner to Perturbation theory...)

Offline Mr Rebooted

  • Fractal Phenom
  • ****
  • Posts: 55
Re: How to get second reference when using Perturbation Theory?
« Reply #8 on: November 09, 2020, 11:43:50 PM »
Checking for the Glitch just made things look bad

How do I even check for the Glitch without it acting up like this?

I check it like this:
Code: [Select]
if (dot(z+dz, z+dz)/dot(z, z) < pow(10, -3)) {
            glitchedPixel = true;
        } else {
            glitchedPixel = false;
        }
}

Offline claude

  • 3f
  • ******
  • Posts: 1833
    • mathr.co.uk
Re: How to get second reference when using Perturbation Theory?
« Reply #9 on: November 10, 2020, 01:25:29 PM »
how would I find a random gliched pixel?
There are at least two ways I can think of, the first is simpler but the second can be parallelized more easily.

1. loop over the image and count the glitched pixels.  if there are any, pick a random number in [0..count).  loop over the image again, counting glitched pixels, stopping when you reach the number you picked.  output the coordinates at hat point.

2. loop over the image.  for each glitched pixel, pick a random fractional number in [0..1). keep track of the coordinates of the point with the smallest number, and output it at the end.  make sure you detect the case of no glitched pixels at all.

Offline Mr Rebooted

  • Fractal Phenom
  • ****
  • Posts: 55
Re: How to get second reference when using Perturbation Theory?
« Reply #10 on: November 10, 2020, 01:56:12 PM »
There are at least two ways I can think of, the first is simpler but the second can be parallelized more easily.

1. loop over the image and count the glitched pixels.  if there are any, pick a random number in [0..count).  loop over the image again, counting glitched pixels, stopping when you reach the number you picked.  output the coordinates at hat point.

2. loop over the image.  for each glitched pixel, pick a random fractional number in [0..1). keep track of the coordinates of the point with the smallest number, and output it at the end.  make sure you detect the case of no glitched pixels at all.

Just by simplifying that, you've made my life a whole lot easier. Thanks!

Offline Mr Rebooted

  • Fractal Phenom
  • ****
  • Posts: 55
Re: How to get second reference when using Perturbation Theory?
« Reply #11 on: November 10, 2020, 02:03:44 PM »
Problem Solved!!


xx
"Time Span"

Started by cricke49 on Fractal Image Gallery

0 Replies
900 Views
Last post August 02, 2018, 07:05:21 AM
by cricke49
xx
Reference Point for Reference Orbit

Started by mrmath on Fractal Mathematics And New Theories

2 Replies
437 Views
Last post December 10, 2017, 05:14:03 PM
by mrmath
xx
Perturbation theory

Started by gerrit on Fractal Mathematics And New Theories

213 Replies
12798 Views
Last post August 12, 2020, 07:38:03 AM
by gerrit
question
The magic behind Perturbation theory

Started by FractalAlex on Kalles Fraktaler

11 Replies
359 Views
Last post June 11, 2020, 08:39:25 PM
by claude
clip
Perturbation Theory works! However...

Started by Mr Rebooted on Programming

4 Replies
207 Views
Last post November 10, 2020, 04:12:18 AM
by 3DickUlus