menpo/menpo — pull request #314 by jabooth (2014-05-06 14:25:24+00:00)
Title: Menpo's Differentiable interfaces.

This PR solves #258. It is a WIP, and will proceed in stages.
## Idea
The end goal is to implement a family of interfaces at `menpo.base` which make clear what parts of menpo are differentiable and how.

The interfaces are as follows:

``` python
# Implemented by objects who can compute a first order
# derivative wrt their parameterization (from as_vector())
class DP(object):
def d_dp(self, points):
...

# Implemented by objects who can compute a first order
# derivative wrt coordinate system
class DX(object):
def d_dx(self, points):
...

# Implemented by objects who can compute a first order
# derivative wrt coordinate system at
# a null parameterization (as_vector() = [0] * n_params)
class DX0(object):
def d_dx_0(self, points):
...

# Implemented by objects who can compute a first order
# derivative wrt a set of ingrained landmark points
class DL(object):
def d_dl(self, points):
...
```

## Progress
- [x] Add all interfaces to `menpo.base`
- [x] Add docs to `DX`
- [x] Implement `DX` and `d_dx` in place of `jacobian_points`
- [ ] Add docs to `DP`
- [ ] Implement `DP` and `d_dp` in place of `jacobian`
- [ ] Add docs to `DL`
- [ ] Implement `DL` and `d_dl` in place of `weight_points`
- [ ] Fix shape of `DL` tensor to be consistent with rest of Interface
- [ ] Change `RadialBasisFunction` to use `DL` not `DX`
- [ ] Implement `DX` on PWA properly
- [ ] Investigate `DX0`
- [ ] Change `PDM` to `ModelInstance`
- [ ] Move `d_dp` from `PCAModel` to ModelInstance`
- [ ] Fix up fitter/fitting to use `ModelInstance` not `PCAModel`