I don't like `J` as a function name: what about:

```python
cost_grad_fun = lambda t: mlp._cost_grad(t, ...)
cost_fun = lambda t: cost_grad_function(t)[0]
grad_fun = lambda t: cost_grad_function(t)[1]
```