MatrixNet: Learning over symmetry groups using learned group representations