HW1 : Unsupervised Learning of Manifolds

Part A: Rotation Discovery
The 3-Dimensional manifold of rotation about 3 distinct points and their combined manifold (at FOV 120degrees and rotational-increment of 1degree) is given below(3d space and 2d projection):
Point_1 Point_1 Point_2 Point_1 Point_3 Point_1 combined Point_1

Part B: Discover x-y motion with rotation

FOV: 120 degrees
This is the manifold obtained using definite trajectory. Bot started from near top left corner and randomly took one step in left/right/top/bottom direction.
trajectory
Manifold obtained using 1k random points and 5 random angles at each point(i.e. 5k images)
trajectory
Manifold obtained using 10k random images:
trajectory

Part C: Unsupervised Learning
The steps followed were:
1. 10k random points were fitted into the isomap f:n from sklearn library and reduced dimensions were stored.
2. A testing data of random 600 images was transformed into reduced dimensions by the fitted model using isomap.transform(X) function. These dimensions were also stored.
3. Found the nearest neighbour of each testing data into the training data and returned the (x,y,theta) of that neighbour.
4. Calculated the Error. Since both training data and testing data is random, result should be unbiased. Since it is not possible to show error for each point, I am just showing it graphically:

In the graph below, red dots are the testing data which was fitted into training data(yellow dots):
fit
In the graph below, the red dots are the predicted cordinates and yellow dots are the actual cordinates(vertical axis is theta):
prediction
In the graph below, the red dots are the error values i.e. Y(predicted) - Y(actual) on a scale of actual cordinates(Yellow dots).Vertical axis is theta. If the learning was perfect all the red dots would have been at Origin. (Please also note that some points seem highly off-predicted are actually +/-350 apart in degrees domain,so effectively it reduces to +/-10 degrees only) :
error
RMS values of error(at FOV 120degrees): x: 78pixels y: 83pixels. Error can be reduced by increasing the training data to ~100k and by using more sophisticated methods of unsupervised learning.

Part D: Re-Construction Error
The plots of Reconstruction-Error v/s Dimension are given below for different cases:

1. For rotation around 3 points:
rotation
2. For 5k random points:
random
3. For 5k points of the trajectory:
trajectory

Answers to Questions Asked:

1. Yes it is very necessary to have textures/gradient on wall so that the images are different. manifold can't be generated on same images. Position can't be determined by vision if all you see is one color. If indivual walls were differently colored then bot need to have a FOV such that it gets the intersection color everytime i.e. FOV > 180degrees will be needed in that case. Even then the manifold will be discontinuous.

2. If we use Z-cordinate instead of rotation, the manifold will no longer be like a flattened torus, and will be more distributed in the 3d across all the 3 axes (in case of completely random motion). And the ring-like distribution won't be there.

3. The limitations are :
a. Explicit motion in z direction will require more dispacement, hence more energy and more time than rotation.
b. Most of the terrains are planar with obstacles, where rotation will discover the map faster than motion in z direction.
c. In problems like the one given for assignment, motion in z direction will be meaningless, since vertical variation doesn't occur.

Code here