Executing gradient descent on the earth
fosterelli.co
fosterelli.co
Is that un-intuitive, or am I looking at it the "wrong" way? I'm imagining the overlap of a 2D square/unit-circle versus the overlap of a 3D cube/unit-sphere, and from those two data points there's already a downward trend.
I mean, the 2D case is really just the single cross-sectional slice from the 3D case through the middle, the one that that has the greatest possible overlap. All other possible slices will less overlap.
Following that logic, a 3D square/cube overlap is likewise the the "middle cross-section of greatest overlap" for a 4D scenario, etc.
I give you a megabox: a million dimensional hypercube spanning one meter along each axis. I also provide a bunch of megaspheres, million-dimensional hyperspheres scaled to be 0.99 meters in diameter. How many megaspheres can you fit into the megabox?
Meaning, in a million-dimensional meter-diameter hypercube, exactly-opposite corners will be a kilometer apart. There's a lot more diagonal wiggle room than you think.
The coordinates of the centre of each megasphere have to lie in the range [0.49,0.51]. Let's just think about megaspheres which are pushed as far as they will go into some corner, so their coordinates are each either 0.49 or 0.51. For each of the one million directions, the distance between the centres of two megaspheres in that dimension will either be 0.02 or 0, depending if their coordinates are the same or different. So by Pythagoras' Theorem the total distance between their centres will be sqrt(n)0.02, where n is the number of dimensions in which their coordinates differ. In order for them to fit the distance must be at least 0.99, so we need sqrt(n)0.02 >= 0.99, which means we need n >= 2451. But we have 1000000 coordinates to choose from, so it's not hard at all to make sure that at least 2451 of them differ. We can start with the sphere whose centre has all coordinates equal to 0.49. Then the sphere with coordinates 0.51 in the first 2451 dimensions, and all others 0.49. Then the sphere with coordinate 0.51 in the next 2451 dimensions. And so on.
That squeezes in at least 1000000/2451 = 407 spheres, but even after that there's loads more room. How about the sphere that has coordinates 0.49 and 0.51 alternating? Or changing every 3? In fact if we just assign coordinates at random then each dimension has a 50/50 chance of being different, so we would expect them to be different in 500000 dimensions. The probability of them being different in only 2450 dimensions is given by (1000000 C 2450)/(2^1000000) = 10^-293570. The number of pairs of spheres is quadratic in the number of spheres. So if we just shove the spheres into corners at random we can expect to place about sqrt(1/10^-293570) = 10^146785 spheres before two of them collide.
And that still leaves loads of room away from the corners! The point at (0.5,...,0.5) is still a distance of sqrt(1000000)0.01 = 10 away from the centre of any sphere we've placed so far, so there's still plenty of space for more spheres.
EDIT: The coordinates should actually be 0.495 and 0.505, but the principle is the same.
1: http://algassert.com/puzzle/2014/07/08/Boxing-Megaspheres.ht...
Let V be the volume (content) of a hypersphere of radius 0.99 (twice the radius of the spheres in the question). The total volume in which the centres of the spheres can lie is 0.01^1000000. So if the densest packing uses n spheres, then we must have nV >= 0.01^1000000 or else there would be a point at least 0.99 away from the centre of any sphere, and we could add an extra one there.
Using Stirling's approximation to bound V above gives that n is greater than 10^388118.6...
Even if it does - you can build intuitions to explain unintuitive results. Unituitive is subjective and a similar word would be "surprising". Because you can look at data to explain a surprising result - it doesn't make the initial result less surprising.
If you consider only the "orange peel", if the center is 0 and r=1, then the 1D version is just two points {-1} and {1}, not only one point.
If you consider only the "whole orange" then the 1D case is the segment [-1, 1], if the center is 0 and r=1
In both case it is equal to the 1D "square" equivalent.
How so usually in Pure Mathematics(Analytic area's) everything done in R^{1} R^{2} is usually generalized to R^{N} and much of the intuition carriers over. So how does it fail here in the context of Machine Learning ?
Note: I know nothing about ML :(
The discrepancies appear when you start dealing with probabilistic stuff. Suddenly everything’s conditioned by everything else, and your complexity skyrockets. Example: it’s easy to find people with about average height and weight, but the more physical characteristics you measure (increasing dimensionality) the more like you are to find something statistically unusual, eg very long fingers. Very interesting Air Force research on this [0]
WRT to optimization, higher dimensions can help avoid the local minima problem. When you have 1000s if possible directions to go, it’s unlikely that none of them will yield a better answer.
[0] https://www.thestar.com/news/insight/2016/01/16/when-us-air-...
In fact we can be very precise. The Dead Sea has a catchment area of 41650 km^2, which is 0.0000816 of the Earth's surface. So we need on average 12200 random initializations in order to find the Dead Sea by gradient descent.
And the most important maxima are often surrounded by lots of local maxima. They may also have some steep slopes so gradient methods can easily overshoot. Sometimes the surface function is not even continuous (overhanging walls).
From the article: "It turns out that the earth is filled with local minima"
(I suspect the deal is that you're right that water always flows downhill to the ocean; but that it often happens at scales too small to capture in the GIS data, or underground.)
Sure, when you increase the "resolution" to meters or smaller, there will be an endless number of mini-endorheic basins. For example, the former Collect Pond in NYC:
For now I'm sticking with the path down the Hoh River. ;)
edit:typo
And now, do Adagrad, RMSProp, RMSProp + Nesterov and Adam, and maybe Newton, BFGS, L-BFGS and conjugate gradients, and then coordinate ascent :)
It would be a pretty good educational tool to teach people the different gradient descent methods, though it's probably too simple of a problem for these methods to be at all useful.
I guess if you're going to count the surface of the oceans as part of the descent you have to remember the surface of the ocean is not uniform in altitude neither due to tidal forces nor other factors.
Ehm, no. The lowest point should have been somewhere 413 meters below sea level (Dead sea depression).
Earth is actually a very difficult place to perform gradient descent on, due to its very large plateau (oceans).
(Edit: lowest point is 413 meters)
Anyone sitting at a computer right now have a few minutes to make an animation of this? I'd love to see it in action.