Questions tagged [differentiation]

The process of finding a derivative.

In calculus, a branch of mathematics, the derivative is a measure of how a function changes as its input changes. Loosely speaking, a derivative can be thought of as how much one quantity is changing in response to changes in some other quantity.

The derivative of a function at a chosen input value describes the best linear approximation of the function near that input value. For a real-valued function of a single real variable, the derivative at a point equals the slope of the tangent line to the graph of the function at that point. In higher dimensions, the derivative of a function at a point is a linear transformation called the linearization.[1] A closely related notion is the differential of a function.

236 questions
2
votes
0 answers

How is the smooth Dice coefficient is differentiable but not the smooth IoU?

I would like to know how the smooth Dice coefficient is differentiable but not a smooth IoU. Exactly which part of smooth IoU makes is non-differentiable, since the equation for two seems quite similar. Calculus or differentiation isn't my strong…
2
votes
1 answer

Custom Gradients in Tensor Flow - Unable to understand this example

I keep thinking that I am about to understand custom gradients but then I test it out this example and I can just not figure out what is going on. I am hoping somebody can walk me through what exactly is happening below. I think this essentially is…
briry12
  • 21
  • 3
2
votes
1 answer

Step by step differentiation with sympy

I'm trying to make a python proram to find derivatives and integrals as well as showing how. I have so far found that there is an integral_steps function which returns the steps used, but I have not found an equivalent for differentiation. Does…
2
votes
1 answer

Partial differentiation using Coqelicot on Coq

I want to partially differentiate functions which expects n arguments for arbitrary natural number n. I hope to differentiate arbitrary an argument only once and not the others. Require Import Reals. Open Scope R_scope. Definition myFunc (x y z:R)…
Daisuke Sugawara
  • 311
  • 4
  • 20
2
votes
1 answer

PyTorch: Is it possible to differentiate a matrix?

How do you differentiate a matrix in PyTorch? I have tried the following but neither work: Instance 1: a = torch.tensor([1., 2, 3], requires_grad=True) b = torch.tensor([4., 5, 6], requires_grad=True) c = a*b c.backward() #print(b.grad) >>>…
YJH16120
  • 419
  • 1
  • 4
  • 15
2
votes
0 answers

numericDeriv alters result of eval in R?

I've run into something unexpected (for me, maybe). Take a look at the code bellow: > env1 = new.env() > env1$x = rnorm(10) > env1$a = 3 > eval(quote(x^a), env1) [1] 0.26046508 1.37188255 -0.17077313 0.25959068 -3.38565765 [6] 0.11537940…
rcon1
  • 21
  • 3
2
votes
0 answers

Maxima: equations: eliminate variable inside diff() expression

I have this code: (%i3)depends([y,x],t)$ eqsp: [y=2*x, v=diff(y,t,1)+y]; eliminate(eqsp,[y]); (eqsp) [y=2*x,v='diff(y,t,1)+y] (%o3) [-'diff(y,t,1)-2*x+v] And this is a picture for better visualization: PNG of code in wxMaxima I…
2
votes
0 answers

Gradient computation in Tensorflow

I am using Tensorflow v1.14 for creating networks and training them. Everything works fine and I don't have any problem with code. I use the function tf.reduce_min() in my loss function. For the gradients to flow, it is essential that the loss…
learner
  • 3,168
  • 3
  • 18
  • 35
2
votes
0 answers

Why does mpmath-function "diff" produce error AttributeError: 'MPContext' object has no attribute 'difference'?

I wanted to differentiate a function by using mpmaths function diff. In order to just try if everything works on a simple example, I used an example being described in the documentary. But it threw the error "AttributeError: 'MPContext' object has…
Johnny A
  • 21
  • 3
2
votes
1 answer

maxima gradef differentiation

I try to define the derivative of the standard normal pdf in terms of the function: φ(x) := exp (-x^2/2)/sqrt(2 * %pi); gradef(φ(x),-x*φ(x)); but if I type then: diff(φ(x),x); I get: -(x*%e^(-x^2/2))/(sqrt(2)*sqrt(%pi))` not as I want…
Karl
  • 263
  • 3
  • 10
2
votes
2 answers

From symbolic to proper differentiation in Maxima

I'm struggling to find a way to switch from a symbolic declaration of the differential operator to its implementation I give you an example. F: (10-'diff(x(t),t)^2 -2*x(t)*'diff(x(t),t) -5*x(t)^2)*%e^(-t); E: ratsimp(diff(F, x(t)) - diff(diff(F,…
Marco Repetto
  • 336
  • 2
  • 15
2
votes
0 answers

OCaml Function to Perform Differentiation

I'm currently studying the language OCaml, and was solving an exercise problem when I came across a question that I can't seem to wrap my head around. Here's the question: "Write a function differentiate : expression * string -> expression that…
Sean
  • 2,890
  • 8
  • 36
  • 78
2
votes
1 answer

How to fix shift and scaling errors in an FFT-powered differentiation program?

So I am trying, like many others before me, to sift through all the celestial alignments of phase shifts and normalization coefficients necessary to make differentiation via Fourier transform work. I am trying to use as little code as possible,…
urquiza
  • 307
  • 2
  • 11
2
votes
0 answers

How do I compute Divergence and Curl for 2D vector fields?

I'm coding an applet that displays 2D vector fields in Processing. On a 1000x1000 canvas, I'm drawing a 20-pixel-long arrow starting from every point identified by a grid on the canvas with a direction relative to the components of the vector…
Alberto
  • 21
  • 2
2
votes
0 answers

python compute the jacobian of numpy.array of function

I want compute the numeric Jacobian of system of function contained into a numpy.array my variable are indexed in this way : eq1 = lambda t,u : u[1] eq2 = lambda t,u : u[2] eq3 = lambda t,u : u[3] eq4 = lambda t,u : -8*u[0]+…
Drudox lebowsky
  • 1,020
  • 7
  • 21