I am trying to compute derivative for something like back-propagation analytically, using Maxima. So I write:
declare(N,[scalar,integer]);
declare(i,[scalar,integer]);
declare(j,[scalar,integer]);
declare(m,[scalar,integer]);
declare(n,[scalar,integer]);
assume(N>10);
assume(i<=N,j<=N,m<=N,n<=N);
x1(i):=f(sum(w[i,j]*x0[j],j,1,N));
Now I am trying to evaluate:
diff(x1(i),w[i,m])
and it returns zero, while it is supposed to return
f(...) * x0[m]
Moreover, I've noticed that x1(j)
returns
sum_j=1^N w[j,j] * x0[j]
while I would expect it to change the internal index from j
to some other letter, say j1
and return
sum_j1=1^N w[j,j1] * x0[j1]
Is there any way to make maxima slightly "smarter" in this regards, i.e. to make it compute derivatives with respect to certain indeces and to automatically change the letter when there is a conflict with the input?