Chain model fixes

Small fixes to the  recent ChainModel additions so that they can handle weights that aren't DenseTensor2s. This arises, for example,  when you use adagradrda for learning