August 26, 2013

I'll be organizing the Computational Intelligence seminar this semester.

Will need to

- Arrange volunteers
- send announcements
- send reminders to speakers
- Set up seminar web page

Significant rework.

New field: branch_K and branch_mu to store mean and covariance of all points in curve. Prior_k now does not include offset covariance; stored in branch_K. mu_b and Sigma_b now store the branch point means and covariances for all views

fix kernel to not include offset index

Finished implementation. Has bugs.

Example:

```
start_pt = [0 100];
ml = [];
for i = 1:2
Corrs = attach(Corrs, 2, 1, start_pt(i), 0, params);
ml(i) = curve_tree_ml_2(Corrs, params, data_);
end
assert(ml(1) == ml(2));
```

*Fixed* - stupid bug in `attachment/attach.m`

- was index offset was hard-coded to zero due to a refactoring mishap.

Example:

```
start_pt = [0 10 50 100 1000 5000];
ml = [];
for i = 1:2
Corrs = attach(Corrs, 2, 1, start_pt(i), 0, params);
ml(i) = curve_tree_ml_2(Corrs, params, data_);
end
assert(all(diff(ml) > 0);
```

*Solved* - curves were reversed.

Should add a `reversed`

flag, which reverses indices before building likelihood and prior. currently, constructing the likelihood occurs during the "backproject and re-index" phase, in file `correspondence/corr_to_likelihood.m`

. Should refactor likelihood construction into its own function, so we don't have to re-backproject when we don't need to.

Let's review the data-flow so we can see more clearly where everything happens.

- propose association and attachment
- By sampling (no code yet)
`train/labels_from_ground_truth`

- propose from ground truth.**Output**: assoc {}

- Construct track
`correspondence/make_correspondence`

**Output**: Corrs {}; Corr.ml_2d

- Correspondence and triangulation
`correspondence/build_full_correspondence.m`

- build from scratch`correspondence/merge_correspondence_2.m`

- merge two pieces**Output**:`corr`

,`means`

,`precisions`

,`cov_error`

- backproject and estimate curvature
`correspondence/corr_to_likelihood.m`

-**Output**:`ll_{means, precisions, indices}`

,`curve_sm*`

- construct likelihood (flatten, sort, and reverse if needed)
`correspondence/flatten_sort_and_reverse.m`

- (doesn't exist yet)**Output**:`ll_{means_flat, precisions_flat, indices_flat, S}`

- handle attachment recursively
- compute conditional prior
`attachment/att_set_start_index.m`

**Output**:`start_index`

,`prior_K`

,`prior_indices`

- compute branch point posterior
`attachment/att_set_branch_index.m`

**Output**:`branch_index`

,`mu_b`

,`sigma_b`

,`branch_K`

,`branch_mu`

- compute conditional prior
- Compute (ML, argmax, etc)

Consider renaming step 4. backproject against rough triangulation; estimate curvature at each point; determine index set. At this point, the order of points don't matter, because the index set hasn't been put to use.

**Action: reverse curve** - detach?, rerun step 5, 6.1 & 6.2 on self, update branch point & rerun 6.2 for children.

(TODO)

- optimize test
- get attachment, reversal, and branch points from ground truth
- store
`ml_2d`

with corr. update on merge. use during ml computation instead of data_