I am trying to implement LM for my research project. The functions is in the form of $f(x,params) = y$. The issue is that for each value of $x$, there are five values of $y$, even for same $params$. So $x$ is a 1D matrix (for example, of size $1 \times 40$) and $y$ is a 2D matrix (for example, of size $5 \times 40$). I am stumped when calculating the Jacobian and the Hessian, which become 3D matrices and that in turn make the change in $params$ a 2D matrix, where as $params$ is a 1D matrix (for example, of size $1 \times 4$). Does anyone know what is the solution to this?
I am roughly following this - https://engineering.purdue.edu/kak/computervision/ECE661.08/homework/HW5_LM_handout.pdf.