Hi Oscar, Thanks for the answer. I was trying to find the values of w1, w2 from loss2 (starting with calculation of all partial derivatives). Are you suggesting not to work on the matrix in loss2?
I know how the problem can be tackled through numerical differentiation (gradient descent), but I was trying to use symbolic computation. Do you know of a similar task already solved via symbolic computation (and available online)? On Sunday, May 31, 2020 at 8:59:50 PM UTC+2, Oscar wrote: > > On Sun, 31 May 2020 at 18:44, Giuseppe G. A. Celano > <[email protected] <javascript:>> wrote: > > > > PS: I checked my previous post and the code I wrote looks correct: > > Your code is correct but it is probably not a good way of solving your > actual problem. > > What would make more sense as a use of sympy is to use sympy to derive > a matrix formula for the solution and then use numpy to calculate the > numeric solution with that formula using your input data. > > If your actual problem is a purely numeric linear-least-squares > problem then numpy/scipy can already solve this pretty well and will > be more effective than sympy for large inputs. If your problem is more > complex and has a nontrivial formula for the solution then sympy might > be a good tool to find that formula. > > -- > Oscar > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/28162366-4eca-4a20-bdd7-173d9cc46511%40googlegroups.com.
