Start of re-write *not* using hmatrix so that we can use ad.
The non hmatrix implementation matches the hmatrix implementation but
something is still defaulting to Double :-(
We now get the derivative but given we have so many variables, it's
difficult to check it is correct. Also we have to update the weights
using the derivatives and the learning rate.