I cannot understand is the difference created by changing the model. compile() line.

Also I am unclear as to why directly substituting the value of the function will lead to a more accurate answer.

Please help

Regards

I cannot understand is the difference created by changing the model. compile() line.

Also I am unclear as to why directly substituting the value of the function will lead to a more accurate answer.

Please help

Regards

1 Like

Hello, @Vedbhai,

Two changes. â†“

e^x and e^{-x} are easily evaluated to be very large or small numbers. For example, when x = 10, e^{10} > 22000 and e^{-10} < 0.0001. While these numbers are not â€śveryâ€ť large/small, but what if x=100 or even larger? The problem is, very large number can cause overflow, and very small number will be zeroed out.

Accuracy is increased because we can mathematically simplify the following equation into something that avoid the very large number problem and lessen the very small number problem.

The following thread shows the simplification. Since these courses are designed to be not Maths intensive, so it would be fine to skip the simplification.

Cheers,

Raymond

1 Like