Hi, I have a problem with the output of an evaluated function.
I am doing a school project that involves matrices and the logistic sigmoid. I've created a function that takes as parameters four matrices and should give back a tensor from which I'm supposed to extract a matrix. The problem is this: when I evaluate the function the result is a tensor where each element is an expression with a backtick (this one: ` ) on the right that doesn't allow any further calculation. To evaluate the expressions in the tensor, and get what I want, I have to copy the output in another input space and remove manually all the backticks.
Here is the code:
(* Matrices *)
A = {{.2, .8}}
W = {{.3}, {.6}}
Q = {{.4, .6 , .2}}
T = {{.5, .1, .1}}
(* Functions *)
Output[a_, w_, q_] := LogisticSigmoid[LogisticSigmoid[a.w].q]
Error[a_, w_, q_, t_] := (t - Output[a, w, q])^2
Derror[a_, w_, q_, t_] = D[Error[a, w, q, t], q]
(* And until here it's all right *)
(* Here come the troubles *)
Derror[A, W, Q, T]
The output when executing Derror is:
{{0.0309271 {{0.631812}}.1,
0.238167 {{0.631812}}.1,
0.214915 {{0.631812}}.1}}
And if i put that in the input space (just pasting, without executing it) I get:
{{0.030927085534456576` {{0.6318124177361016`}}.1,
0.23816694971195315` {{0.6318124177361016`}}.1,
0.21491527050353018` {{0.6318124177361016`}}.1}}
The expected result is:
{{{{0.00195401}}, {{0.0150477}}, {{0.0135786}}}}
But to get to that I have to input:
(* The output of Derror but with backticks removed *)
{{0.030927085534456576 {{0.6318124177361016}}.1, 0.23816694971195315 {{0.6318124177361016}}.1, 0.21491527050353018 {{0.6318124177361016}}.1}}
Why is this happening? I'm not very trained in Wolfram Mathematica so I really don't know what to do. I searched the web but I found nothing. I tried with converting the output to string, replacing "`" with "", and than converting the string to expression again but nothing, it's useless. Look forward to find some answer here and sorry for my english (i'm not from an english-speaking country).