# Higher order derivatives/ automatic differentiation

**URL:** <https://discourse.julialang.org/t/higher-order-derivatives-automatic-differentiation/107936>\
**Category:** Machine Learning\
**Tags:** question, flux, autodiff\
**Created:** [December 22, 2023, 8:12am UTC](https://discourse.julialang.org/t/higher-order-derivatives-automatic-differentiation/107936 "2023-12-22T08:12:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [December 23, 2023, 8:38am UTC](https://discourse.julialang.org/t/higher-order-derivatives-automatic-differentiation/107936/2 "2023-12-23T08:38:58Z")

</div>

> [@ayushinav](#):
>
> ```julia
> ode(t)= d2uNN(t)+ μ*duNN(t)+ k*uNN(t);
> loss_ode()= Flux.mse(ode.(t_coll), zero(t_coll));
> λ_bc, λ_ode= 1, 1;
> loss()= loss_bc1()+ λ_bc*loss_bc2()+ λ_ode*loss_ode();
> 
> ```

I am skeptical that loss for ode works. It is dominant over boundary cost so optimiser tries to go to a local minima where it can zero out all u′′, u’ and u except in the boundary. I had tried it in [this question](https://discourse.julialang.org/t/pinn-using-flux/107782) and it seemed following ode cost does not work really even though it has much less λ\_ode. The PINN implementation asked several times in this discourse from the searches. You may find your answers in one of them maybe.

---

_[View the full topic](https://discourse.julialang.org/t/higher-order-derivatives-automatic-differentiation/107936)._
