Ethan Wu

Results 44 issues of Ethan Wu

```julia using Flux, Zygote model = Dense(3,1) grad_f(x) = gradient(x -> sum(model(x)),x)[1] Zygote.jacobian(grad_f,rand(3)) ERROR: Can't differentiate foreigncall expression. You might want to check the Zygote limitations documentation. https://fluxml.ai/Zygote.jl/dev/limitations.html Stacktrace: [1]...

second order

Closes #1264 `Zygote.forward_jacobian` is not well maintained and the motivation for using it is not clear.

second order

```julia julia> function f(x, bias) jac = Zygote.jacobian(x->x.^3, x)[1] return jac * x .+ bias end f (generic function with 1 method) julia> x,bias = rand(3),rand(3) ([0.2279638899624825, 0.6476786632858718, 0.13745627655377346], [0.051516386842686224,...

second order

Reverse on forward on reverse: ```julia julia> function f1(x, ps) # [edit: renamed not to clash] hess = Zygote.hessian(x->sum(x.^3), x) return hess * x .+ ps.bias end f1 (generic function...

second order

Note that the issue always exists and is not recently introduced. ```julia using Lux, Random, NNlib, Zygote, CUDA, ComponentArrays CUDA.allowscalar(false) using ForwardDiff model = Chain(Dense(2 => 4)) rng = Random.default_rng()...

I rewrote the [example](https://docs.sciml.ai/dev/modules/SciMLSensitivity/pde_fitting/pde_constrained/) with `MethodOfLines`. I believe it should be a more desired approach. ```julia using Plots using DifferentialEquations, Optimization, OptimizationPolyalgorithms, Zygote, OptimizationOptimJL using DomainSets, MethodOfLines, ModelingToolkit, SciMLSensitivity #...

```julia julia> func(x) = sum(repeat(x, inner = (1, 3))) func (generic function with 1 method) julia> func(CUDA.rand(2,3)) 7.5995846f0 julia> Zygote.gradient(func,CUDA.rand(2,3)) ERROR: Scalar indexing is disallowed. Invocation of getindex resulted in...

bug
GPU

Need https://github.com/jonniedie/ComponentArrays.jl/pull/164 to actually work

With the recent update this should work now.

I have an inverse problem where the parameter function is a function of the solution, what is the correct way to implement it? ```julia using ModelingToolkit, NeuralPDE, Lux, Random, NNlib...