Finished debugging changes to corr_to_likelihood
.
Recap: since projected model curves are discretely sampled at coarse intervals, multiple observed points may correspond to the same model point. The results below show this. The projected model curve is sampled every 2 pixels (index_delta_2d
), so each model point has between 2 and 3 corresponding data points.
The new scheme post-processes the indexes by linearly interpolating the model curve and projecting the data point onto the neighboring line segments. Resulting indices are much improved:
Note that viewing angle distorts the correspondence angles somewhat. Non-perpendicular correspondence lines may be simply due to non-orthogonal viewing direction.
Since coarse sampling is no longer an issue, we can increase the 2D sample period and still get good results. Below is the result after increasing 2D sampling period from 2 to 5:
This has implications on training results. Re-running training using exp_2013_08_11_train_all
:
No Perturb Model
smoothing_variance: 0.0030
noise_variance: 1.0805
position_variance: 1.6270e+04
rate_variance: 0.2904
perturb_smoothing_variance: 1
perturb_rate_variance: 1
perturb_position_variance: 1
perturb_scale: 2.5000
Final ML: -9.094636e+03
Ind-Perturb Model
smoothing_variance: 0.0034
noise_variance: 0.3472
position_variance: 1.6458e+04
rate_variance: 0.2605
perturb_smoothing_variance: 1.4186e-06
perturb_rate_variance: 3.0555e-04
perturb_position_variance: 0.5467
perturb_scale: 2.5000
Final ML: -6.203953e+03
OU-Perturb Model
smoothing_variance: 0.0035
noise_variance: 0.3486
position_variance: 1.6440e+04
rate_variance: 0.2587
perturb_smoothing_variance: 1.4874e-06
perturb_rate_variance: 3.6269e-04
perturb_position_variance: 0.7241
perturb_scale: 2.3364
Final ML: -6.156721e+03
SqExp-Perurb Model
smoothing_variance: 0.0035
noise_variance: 0.3479
position_variance: 1.6246e+04
rate_variance: 0.2745
perturb_smoothing_variance: 1.5495e-06
perturb_rate_variance: 4.1614e-04
perturb_position_variance: 0.6613
perturb_scale: 0.9654
Final ML: -6.159716e+03
Awesome news: perturb smoothing variance is now non-negligible! There must have been so much IID noise resulting from bad indexing that it totally masked the perturb smoothing variance.
The totally validates our efforts to fix indexing. Before, the model was fundamentally broken; bad indexing was preventing us from making any correct inferences beyond a certain level of granularity. By fixing indexing, we're suddenly able to everything clearly, whereas before we were squinting through a noisy haze.
Other observations
Lets see if anything interesting comes out of our reconstructions...
OU-perturb Model
az = 24;
el = 16;
axis_ = [ 70.0000 110.0000 50.0000 110.0000 47.8040 224.0467 ]
exp_2013_08_11_reconstruct_for_web(test_Corrs_ll_2, retraining_results{3}, 3, axis_, el, az, num_views, '/Users/ksimek/src/research_blog/img/2013-08-16-ou-model-%d.png', '/ksimek/research/img/2013-08-16-ou-model-%d.png', 'ou-reconstruct-anim', true)
SqExp-Perturb Model
We can remove perturbations that arise from poor camera calibration by assuming it is captured in the linear and offset perturbations; under this assumption, the remaining cubic-spline smooth perturbations capture the true plant motion.
Command:
reverse = false(1,num_tracks);
reverse([1 2 4 5 6 8 9 10 11 12 14 15]) = true;
% error above, should omit 11:
% reverse([1 2 4 5 6 8 9 10 12 14 15]) = true;
exp_2013_08_16_visualize_smooth_perturbations( ...
test_Corrs_ll_2, ...
retraining_results{3}, ...
3, axis_, el, az, num_views, ...
'/Users/ksimek/src/research_blog/img/2013-08-16-ou-model-smooth-%d.png', ...
'/ksimek/research/img/2013-08-16-ou-model-smooth-%d.png', ...
'ou-reconstruct-smooth-anim', reverse)
Results:
It's notable that the little curves at the top don't move. Attaching them to the large main step will allow them to move, which should improve ML.
It should also significantly affect training if we train with attachments in place. Perturb_position_variance should be responsible for less of the variance, and perturb_smoothing_variance should explain more.
Tasks: