Tuesday, 3 March 2015

London Python Group

I was lucky enough to present a flash talk on Make Your Own Mandelbrot at the London Python Group.

One of the great things about such grassroots groups is the openness, honestly and generousness - unlike corporate events. I picked up some pointers on things I didn't know:

  • The IPython Cookbook has some content on interactive UI elements (widgets) for IPython Notebooks. Something I always wanted to know how to do.
  • An example of GPU accelerated computation in IPython notebooks for generating Mandelbrot fractals. 

Sunday, 8 February 2015

Make Your Own Neural Network

I'm now focussing on my next ebook Make Your Own Neural Network.

The central idea is the same, to make sure that anyone with interest and nothing more than school-level maths can understand how neural networks work, and appreciate the pretty cool concepts on the way! Again we'll use Python and assume no previous knowledge of programming.By the end of the guide, you'll have built a simple neural network that recognises human handritten numbers.

 
You can follow progress and discussions at: http://makeyourownneuralnetwork.blogspot.co.uk/ and @myoneuralnet

Friday, 24 October 2014

LinuxVoice Magazine

I'm really pleased that LinuxVoice Magazine has published the first of my 2-part series on Python and the Mandelbrot fractals.


I hope the series will inspire those completely new to programming to try it - the tutorials require no previous experience at all.

And I also hope the mathematics - which is no more difficult than school maths - will inspire young and old by showing that it can be surprising, exciting and beautiful!

I'd like to thank Graham, the editor of LinuxVoice, for being so accommodating, helpful and patient with me.

By the way, I've been reading computer magazines for over 20 years and LinuxVoice has refreshed enthusiasm, community spirit, and quality content - best wishes for its future!




Grab a copy of issues 009 and 0010 - out now and next month!


Saturday, 27 September 2014

Oil Painting Fractals

I was exploring artistic filters in image editing software - you know the kind that make an image look like it was really sketched with an ink pen or painted in watercolours.

The usual software wasn't doing it for me because the effects looked very fake, so I explored further and found the free FotoSketcher. Its focus is purely on such effects - and it's brilliant. I particularly like the Painitng 5 (watercolour) and Painting 6  (oil) effects - they are very realistic.

Then it struck me - what if I applied these filters to fractal images? The results, in my opinion, are fantastic! Enjoy .... and do try it yourself!







Wednesday, 27 August 2014

Pure Web Mandelbrot Explorers

I love tools that are purely web based.

The benefits are huge - you don't need to install any software, the software is automatically updated by the supplier, it works across any operating system or device or brand as long as it supports modern open web standards. You can carry on working between devices, from different location, and you don't lose your work if your local device breaks.

You can do quite a lot with pure web technologies - Google's office productivity suite is a great example, so is wakari.io's IPython in the cloud.

You can explore the Mandelbrot fractals purely with a web browser too.

I love the following tools I discovered recently:







Tuesday, 26 August 2014

The Complex Plane And Plottable Arrays

Some readers have asked me to explain the slightly complicated translation between the complex plane (where the Mandelbrot set really lives) and the Python arrays used to plot the images.

The reason for the complexity is that:
  • The complex plane is continuous, just like the real number line.
  • Python arrays are discrete, filled with finite boxes. 
  • What's more, the elements of python arrays are labelled using integers starting from zero. You can have array[2, 3] but not array[-2.34, +4.3398]. 
  • We have to plot arrays, even though we really want to see the complex plane. This is the core reason we need to translate between the complex number plane world, and the python array world.

The translation itself is simple. We divide up the complex plane into equally spaced and sized sections. There are an integer number of these - and so they can be represented by the elements of an array.

So when we choose an element n out of N along a section which started at x1 and ended ay x2, the element n corresponds to x1 + (x2-x1)*(n/(N-1)). You can see here that n/N is the proportion between x1 and x2 that n lies.

If this expression looks complicated to you - it's just working out how far from x1 towards x2 we need to go in the same proportion as n out of N pieces.

Ah - and don't forget n starts at 0 and ends at N-1, which makes sense so that when n=0 we have the position x1. Similarly when n is the last N-1,  it corresponds to x2.

The following diagram shows our explanation visually: (click to enlarge)

The Deep Connection Between Julia and Mandelbrot Fractals

The Julia and Mandelbrot fractals are intimately connected.

They are both generated by iterating the simple function z2 + c.

For the Mandelbrot set, z starts as the value of the point being tested on the complex plane, and c is zero. In effect the function becomes z2 because c is zero.

For the Julia sets, c is set to a contant value throughout all the calculations. In thisway, c uniquely defined that particular Julia fractal. That same c always generates that same pattern.

If you've explored the Julia and Mandelbrot sets, you may suspect that there is a connection between the two. In fact there is:

  1. Julia sets whose unqiue c value falls inside the Mandelbrot set are connected - that is, they are all one piece.
  2. Julia sets whose unique c value fall outside the Mandelbrot set are not connected - that is, they consist of many disconnected pieces. 
  3. Julia sets whose c lies further away from the Mandelbrot set have greater fragmentation, until they become almost dust like.

The following digram summarises this deep connection: (click to enlarge)