# \#ad

**URL:** https://discourse.julialang.org/tag/ad/584.md?page=1

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 2

---

## [Cannot ForwardDiff through linear least squares via QR](https://discourse.julialang.org/t/cannot-forwarddiff-through-linear-least-squares-via-qr/104257)

<div class="topic-metadata">

**Author:** [@Neodym](https://discourse.julialang.org/u/Neodym)\
**Replies:** 6\
**Last updated:** [September 27, 2023, 6:26am UTC](https://discourse.julialang.org/t/cannot-forwarddiff-through-linear-least-squares-via-qr/104257 "2023-09-27T06:26:39Z")

</div>

Hey, I’d like to get derivatives for a linear least squares problem where the parameter appears in the right hand side: using LinearAlgebra using ForwardDiff A = rand(10, 3) b = rand(10) qr\_fact = qr(A) function f(p…

---

## [How efficient is the automatic differentation and optimization in comparison to PyTorch](https://discourse.julialang.org/t/how-efficient-is-the-automatic-differentation-and-optimization-in-comparison-to-pytorch/102824)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 6\
**Last updated:** [August 16, 2023, 3:24pm UTC](https://discourse.julialang.org/t/how-efficient-is-the-automatic-differentation-and-optimization-in-comparison-to-pytorch/102824 "2023-08-16T15:24:16Z")

</div>

Hi all, how efficient is the current Julia AD and optimization landscape in comparsion to let’s say PyTorch? Python For example in PyTorch I can do arr1 = arr1.requires\_grad\_(True) arr2 = arr2.requires\_grad\_(True) opt…

---

## [Simple function using Zygote gradient is type-unstable](https://discourse.julialang.org/t/simple-function-using-zygote-gradient-is-type-unstable/101677)

<div class="topic-metadata">

**Author:** [@Thaegy](https://discourse.julialang.org/u/Thaegy)\
**Replies:** 9\
**Last updated:** [July 16, 2023, 10:47pm UTC](https://discourse.julialang.org/t/simple-function-using-zygote-gradient-is-type-unstable/101677 "2023-07-16T22:47:34Z")

</div>

Hi there, I have been trying to figure out why when I use Zygote to calculate the gradient of a simple function it returns the correct value but if I used @code\_warntype it suggests the function is type-unstable and is r…

---

## [Differentiating Jacobian-vector product for sliced score matching?](https://discourse.julialang.org/t/differentiating-jacobian-vector-product-for-sliced-score-matching/99746)

<div class="topic-metadata">

**Author:** [@Red-Portal](https://discourse.julialang.org/u/Red-Portal)\
**Replies:** 18\
**Last updated:** [June 29, 2023, 5:56pm UTC](https://discourse.julialang.org/t/differentiating-jacobian-vector-product-for-sliced-score-matching/99746 "2023-06-29T17:56:47Z")

</div>

Hi, I’m trying to implement score matching in Julia. Essentially, one needs to differentiate through the expression: \\mathbb{E}\_{v \\sim \\mathcal{N}(0,\\mathbf{I})} \\mathbb{E}\_{x \\sim p(x)} \\left( v^{\\top} \\nabla\_x f(x; …

---

## [Log automatic selection of sensitivity algorithm](https://discourse.julialang.org/t/log-automatic-selection-of-sensitivity-algorithm/100691)

<div class="topic-metadata">

**Author:** [@nina](https://discourse.julialang.org/u/nina)\
**Replies:** 1\
**Last updated:** [June 22, 2023, 9:48pm UTC](https://discourse.julialang.org/t/log-automatic-selection-of-sensitivity-algorithm/100691 "2023-06-22T21:48:19Z")

</div>

Dear all, I am training a universal differential equation with Zygote without specifying what sensitivity algorithm I am using. Hence, according to the SciMLSensitivity Docs a “smart polyalgorithm is used to automatical…

---

## [Hessian of a buffer array in Zygote](https://discourse.julialang.org/t/hessian-of-a-buffer-array-in-zygote/100249)

<div class="topic-metadata">

**Author:** [@tomkimpson](https://discourse.julialang.org/u/tomkimpson)\
**Replies:** 0\
**Last updated:** [June 12, 2023, 10:25pm UTC](https://discourse.julialang.org/t/hessian-of-a-buffer-array-in-zygote/100249 "2023-06-12T22:25:38Z")

</div>

I have a function which takes some coordinates, a parameter, and creates a 2D array. I want to get the Jacobian and the Hessian of this array w.r.t the input coordinates using Zygote. The Jacobian works fine, but the H…

---

## [Using Enzyme with DE.jl](https://discourse.julialang.org/t/using-enzyme-with-de-jl/95302)

<div class="topic-metadata">

**Author:** [@tomkimpson](https://discourse.julialang.org/u/tomkimpson)\
**Replies:** 3\
**Last updated:** [March 10, 2023, 1:30pm UTC](https://discourse.julialang.org/t/using-enzyme-with-de-jl/95302 "2023-03-10T13:30:11Z")

</div>

I am playing with using Enzyme.jl to try to get the derivative of some numerical function with respect to the initial condition. The function is solved using DifferentialEquations.jl. For example: using DifferentialEqua…

---

## [Rodas4 (crashes) versus Tsit5 (works)](https://discourse.julialang.org/t/rodas4-crashes-versus-tsit5-works/95415)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 10\
**Last updated:** [March 2, 2023, 7:56am UTC](https://discourse.julialang.org/t/rodas4-crashes-versus-tsit5-works/95415 "2023-03-02T07:56:23Z")

</div>

@ChrisRackauckas, Here is a minimum working example of solving a 3x3 system using the StaticArrays.jl module. The solver runs fine with Tsit5 but crashes with Rodas. Not clear how that is possible since Rodas4 is a stif…

---

## [Zygote calculate adjoint only for one of several arguments](https://discourse.julialang.org/t/zygote-calculate-adjoint-only-for-one-of-several-arguments/59606)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 5\
**Last updated:** [January 9, 2023, 3:06pm UTC](https://discourse.julialang.org/t/zygote-calculate-adjoint-only-for-one-of-several-arguments/59606 "2023-01-09T15:06:52Z")

</div>

Hey, is there a way that Zygote prevents the calculation of adjoints which are not needed at all? Let’s say we have a function f(a, b) where we only want to have the first gradient: b = #some value g(a) = f(a, b) Zygo…

---

## [Idea to make Zygote support mutation in easy cases](https://discourse.julialang.org/t/idea-to-make-zygote-support-mutation-in-easy-cases/92118)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 6\
**Last updated:** [December 27, 2022, 4:34pm UTC](https://discourse.julialang.org/t/idea-to-make-zygote-support-mutation-in-easy-cases/92118 "2022-12-27T16:34:21Z")

</div>

Motivation The appeal of automatic differentiation is that you can write a function using ordinary Julia and the gradient is automatically computed. Disallowing mutation in that function seems reasonable on the surface—i…

---

## [Non-Zygote autodiff through a FFT-based poisson solver?](https://discourse.julialang.org/t/non-zygote-autodiff-through-a-fft-based-poisson-solver/88191)

<div class="topic-metadata">

**Author:** [@trakjohnson](https://discourse.julialang.org/u/trakjohnson)\
**Replies:** 3\
**Last updated:** [December 14, 2022, 12:16am UTC](https://discourse.julialang.org/t/non-zygote-autodiff-through-a-fft-based-poisson-solver/88191 "2022-12-14T00:16:06Z")

</div>

Hi all, I’m attempting to figure out how to automatically differentiate through code that uses FFTs and IFFTs. I know there are a few topics on this (I’ve referenced some) and I have tried to do my best to get the most …

---

## [Open discussion on the state of differentiable physics in Julia](https://discourse.julialang.org/t/open-discussion-on-the-state-of-differentiable-physics-in-julia/72900)

<div class="topic-metadata">

**Author:** [@JordiBolibar](https://discourse.julialang.org/u/JordiBolibar)\
**Replies:** 9\
**Last updated:** [August 15, 2022, 9:17am UTC](https://discourse.julialang.org/t/open-discussion-on-the-state-of-differentiable-physics-in-julia/72900 "2022-08-15T09:17:07Z")

</div>

I have been thinking about this for some time, as a result of my personal experience starting to work with Julia this year. I chose Julia for my new research project on Universal Differential Equations for glacier evolut…

---

## [Automatic differentiation and Trapz](https://discourse.julialang.org/t/automatic-differentiation-and-trapz/82135)

<div class="topic-metadata">

**Author:** [@chupin](https://discourse.julialang.org/u/chupin)\
**Replies:** 10\
**Last updated:** [June 18, 2022, 5:53am UTC](https://discourse.julialang.org/t/automatic-differentiation-and-trapz/82135 "2022-06-18T05:53:18Z")

</div>

It seems that Nonconvex is not able to deal with the trapz function, but maybe, I’ve done something wrong. The code (that is a nonsense toy code) : using Nonconvex Nonconvex.@load Ipopt using Trapz function obj(hV,N,M)…

---

## [Gradient of a gradient of a FastChain](https://discourse.julialang.org/t/gradient-of-a-gradient-of-a-fastchain/73876)

<div class="topic-metadata">

**Author:** [@mahdiar](https://discourse.julialang.org/u/mahdiar)\
**Replies:** 19\
**Last updated:** [February 8, 2022, 3:58pm UTC](https://discourse.julialang.org/t/gradient-of-a-gradient-of-a-fastchain/73876 "2022-02-08T15:58:28Z")

</div>

What is the best way to differentiate an artificial neural network built by FastChain? The objective is to make a gradient of a neural network output with respect to its output. The result should be differentiable. Her…

---

## [Zygote: Differentiate over Zygote operation?](https://discourse.julialang.org/t/zygote-differentiate-over-zygote-operation/70853)

<div class="topic-metadata">

**Author:** [@ThummeTo](https://discourse.julialang.org/u/ThummeTo)\
**Replies:** 4\
**Last updated:** [November 16, 2021, 9:03am UTC](https://discourse.julialang.org/t/zygote-differentiate-over-zygote-operation/70853 "2021-11-16T09:03:37Z")

</div>

Hello everyone, I wondered, if it is possible to differentiate with Zygote over another Zygote-Operation (I attached a minimal example). using Zygote function myFunction(a) Zygote.jacobian(sin, a)\[1\] end Zygote.j…

---

## [Turing MethodError with reversediff but not with forwarddiff](https://discourse.julialang.org/t/turing-methoderror-with-reversediff-but-not-with-forwarddiff/65633)

<div class="topic-metadata">

**Author:** [@fkrauer](https://discourse.julialang.org/u/fkrauer)\
**Replies:** 2\
**Last updated:** [August 3, 2021, 12:31pm UTC](https://discourse.julialang.org/t/turing-methoderror-with-reversediff-but-not-with-forwarddiff/65633 "2021-08-03T12:31:41Z")

</div>

Hi everyone I have a small ODE model, which runs fine (albeit slow) with Turing forwarddiff AD. However, I cannot get it to run with reversediff (and neither with Zygote). It throws a MethodError (see below). Is this so…

---

## [Extending AD to JuliaImages](https://discourse.julialang.org/t/extending-ad-to-juliaimages/62460)

<div class="topic-metadata">

**Author:** [@SomTambe](https://discourse.julialang.org/u/SomTambe)\
**Replies:** 0\
**Last updated:** [June 6, 2021, 4:31am UTC](https://discourse.julialang.org/t/extending-ad-to-juliaimages/62460 "2021-06-06T04:31:51Z")

</div>

Hi I’m Som! I’m working on extending AD support to the Images.jl ecosystem this summer as a part of SoC. I am building the code here at DiffImages.jl. We have our discussions public at the #discussions tab of the repo. …

---

## [GalacticOptim trips over boundary conditions in DiffEqOperators](https://discourse.julialang.org/t/galacticoptim-trips-over-boundary-conditions-in-diffeqoperators/55060)

<div class="topic-metadata">

**Author:** [@told](https://discourse.julialang.org/u/told)\
**Replies:** 2\
**Last updated:** [February 11, 2021, 2:49pm UTC](https://discourse.julialang.org/t/galacticoptim-trips-over-boundary-conditions-in-diffeqoperators/55060 "2021-02-11T14:49:01Z")

</div>

So I just had time to go back to a project I was working in the past (related to this). Basically I want to solve a Diffusion-Convection problem tracking two phases along a reactor with a source term that is learned by a…

---

## [ReverseDiff.jl gives zeros when using fill](https://discourse.julialang.org/t/reversediff-jl-gives-zeros-when-using-fill/54369)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 1\
**Last updated:** [February 1, 2021, 11:53am UTC](https://discourse.julialang.org/t/reversediff-jl-gives-zeros-when-using-fill/54369 "2021-02-01T11:53:15Z")

</div>

Hey, the following MWE: function g(x) out = fill(0.0, size(x)) for i = 1:size(x)\[1\] out\[i, :\] .= x\[i, :\] end return out end ReverseDiff.gradient(x -\> sum(g(x)), randn((5, 5))) which returns 5×…

[Previous page](https://discourse.julialang.org/tag/ad/584.md?match_all_tags=true&tags%5B%5D=ad)
