# \#neural-network

**URL:** https://discourse.julialang.org/tag/neural-network/654.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

---

## [Nested and different AD methods altogether: How to add AD calculations inside my loss function when using neural differential equations?](https://discourse.julialang.org/t/nested-and-different-ad-methods-altogether-how-to-add-ad-calculations-inside-my-loss-function-when-using-neural-differential-equations/108985)

<div class="topic-metadata">

**Author:** [@facusapienza](https://discourse.julialang.org/u/facusapienza)\
**Replies:** 9\
**Last updated:** [September 28, 2024, 12:16am UTC](https://discourse.julialang.org/t/nested-and-different-ad-methods-altogether-how-to-add-ad-calculations-inside-my-loss-function-when-using-neural-differential-equations/108985 "2024-09-28T00:16:46Z")

</div>

Hi all, I am implementing regularization penalties inside Universal Differential Equations (also applicable to Physics-Informed neural networks) where I need to differentiate a (loss) function that includes in its calcu…

---

## [Parameters in the neural network not updating after training](https://discourse.julialang.org/t/parameters-in-the-neural-network-not-updating-after-training/119914)

<div class="topic-metadata">

**Author:** [@Ashima\_Kalathingal](https://discourse.julialang.org/u/Ashima_Kalathingal)\
**Replies:** 0\
**Last updated:** [September 26, 2024, 12:04pm UTC](https://discourse.julialang.org/t/parameters-in-the-neural-network-not-updating-after-training/119914 "2024-09-26T12:04:53Z")

</div>

I am implementing a Neural ODE in julia. When I complete the training using ADAM optimizer, the loss function decreases as expected. But after training, the parameters reset to the original initial value. So I am not abl…

---

## [Add coordinate transformation before first layer in NeuralPDE.jl](https://discourse.julialang.org/t/add-coordinate-transformation-before-first-layer-in-neuralpde-jl/118769)

<div class="topic-metadata">

**Author:** [@nico](https://discourse.julialang.org/u/nico)\
**Replies:** 5\
**Last updated:** [August 29, 2024, 8:16pm UTC](https://discourse.julialang.org/t/add-coordinate-transformation-before-first-layer-in-neuralpde-jl/118769 "2024-08-29T20:16:54Z")

</div>

Hi, I woud like to add a transformation to the coordinates x and y before they are passed to the first layer of a neural net defined with Lux using NerualPDE.jl. I am implementing physics informed neural networks. The …

---

## [Can't get NeuralPDE Example code to run](https://discourse.julialang.org/t/cant-get-neuralpde-example-code-to-run/118196)

<div class="topic-metadata">

**Author:** [@ericchenanp](https://discourse.julialang.org/u/ericchenanp)\
**Replies:** 0\
**Last updated:** [August 14, 2024, 5:58pm UTC](https://discourse.julialang.org/t/cant-get-neuralpde-example-code-to-run/118196 "2024-08-14T17:58:37Z")

</div>

Hi folks! I’m trying to get the example code for the NeuralPDE package up and running, but copy/pasting it returns the following: ERROR: DivideError: integer division error Does anyone know what I’m doing wrong, or wh…

---

## [Saving/loading a neural network trained with NeuralPDE](https://discourse.julialang.org/t/saving-loading-a-neural-network-trained-with-neuralpde/117583)

<div class="topic-metadata">

**Author:** [@gradureau](https://discourse.julialang.org/u/gradureau)\
**Replies:** 3\
**Last updated:** [July 30, 2024, 4:42pm UTC](https://discourse.julialang.org/t/saving-loading-a-neural-network-trained-with-neuralpde/117583 "2024-07-30T16:42:39Z")

</div>

Hello everybody, I am using neuralPDE to train neural networks and I wish to save them in files to use them later. It works just fine if I use the standard Lux layers. Yet I wish to use the following custom layer at the…

---

## [UDE: Estimating multiple parameters with NN and choosing best optimizers](https://discourse.julialang.org/t/ude-estimating-multiple-parameters-with-nn-and-choosing-best-optimizers/116444)

<div class="topic-metadata">

**Author:** [@MINimal-Code](https://discourse.julialang.org/u/MINimal-Code)\
**Replies:** 6\
**Last updated:** [July 29, 2024, 1:22pm UTC](https://discourse.julialang.org/t/ude-estimating-multiple-parameters-with-nn-and-choosing-best-optimizers/116444 "2024-07-29T13:22:47Z")

</div>

Hello, I am currently trying to implement a UDE to help me create a formulation for 2 parameters in a lung model. The code is based on the tutorial https://docs.sciml.ai/Overview/dev/showcase/missing\_physics/#Visualizing…

---

## [Learning Orbital Dynamics](https://discourse.julialang.org/t/learning-orbital-dynamics/116607)

<div class="topic-metadata">

**Author:** [@Jose\_P](https://discourse.julialang.org/u/Jose_P)\
**Replies:** 16\
**Last updated:** [July 13, 2024, 9:28pm UTC](https://discourse.julialang.org/t/learning-orbital-dynamics/116607 "2024-07-13T21:28:37Z")

</div>

Hi everyone, I am currently learning Julia by working on a project based on the paper “Learning orbital dynamics of binary black hole systems from gravitational wave measurements.” The idea is to reconstruct the original…

---

## [Neural Nets training with multiple Chains Lux.jl and LuxCUDA.jl: LoadError: AssertionError: length(init\_params) == length(depvars) when using multi chains in NeuralPDE.jl GPU example](https://discourse.julialang.org/t/neural-nets-training-with-multiple-chains-lux-jl-and-luxcuda-jl-loaderror-assertionerror-length-init-params-length-depvars-when-using-multi-chains-in-neuralpde-jl-gpu-example/116501)

<div class="topic-metadata">

**Author:** [@BakChin-Hwa](https://discourse.julialang.org/u/BakChin-Hwa)\
**Replies:** 2\
**Last updated:** [July 2, 2024, 5:45am UTC](https://discourse.julialang.org/t/neural-nets-training-with-multiple-chains-lux-jl-and-luxcuda-jl-loaderror-assertionerror-length-init-params-length-depvars-when-using-multi-chains-in-neuralpde-jl-gpu-example/116501 "2024-07-02T05:45:24Z")

</div>

When adapting the GPU example (Using GPUs · NeuralPDE.jl) of NeuralPDE .jl to multiple chains, it does not work. using NeuralPDE, Lux, LuxCUDA, Random, ComponentArrays using Optimization using OptimizationOptimisers imp…

---

## [UndefRefError while running code based on "Automatically Discover Missing Physics by embedding Machine Learning into Differential Equations"](https://discourse.julialang.org/t/undefreferror-while-running-code-based-on-automatically-discover-missing-physics-by-embedding-machine-learning-into-differential-equations/116228)

<div class="topic-metadata">

**Author:** [@MINimal-Code](https://discourse.julialang.org/u/MINimal-Code)\
**Replies:** 3\
**Last updated:** [June 26, 2024, 1:15pm UTC](https://discourse.julialang.org/t/undefreferror-while-running-code-based-on-automatically-discover-missing-physics-by-embedding-machine-learning-into-differential-equations/116228 "2024-06-26T13:15:33Z")

</div>

Hi there, first time posting a question on this forum, I hope I’m doing this right. I am currently trying to modify the code posted in the documentation Automatically Discover Missing Physics by Embedding Machine Learni…

---

## [Neural Networks to describe binary-black-holes trajectories](https://discourse.julialang.org/t/neural-networks-to-describe-binary-black-holes-trajectories/115769)

<div class="topic-metadata">

**Author:** [@Jose\_P](https://discourse.julialang.org/u/Jose_P)\
**Replies:** 4\
**Last updated:** [June 18, 2024, 4:37pm UTC](https://discourse.julialang.org/t/neural-networks-to-describe-binary-black-holes-trajectories/115769 "2024-06-18T16:37:32Z")

</div>

Hello everyone! I am new to Julia and currently working on a project that involves using neural networks to describe geodesics around a black hole. I am encountering an error ‘type Array has no field layer\_1,’ and I am u…

---

## [Hybrid ODE with ContinuousCallback for models of changing sizes?](https://discourse.julialang.org/t/hybrid-ode-with-continuouscallback-for-models-of-changing-sizes/115198)

<div class="topic-metadata">

**Author:** [@natalieisenberg](https://discourse.julialang.org/u/natalieisenberg)\
**Replies:** 25\
**Last updated:** [June 17, 2024, 3:39pm UTC](https://discourse.julialang.org/t/hybrid-ode-with-continuouscallback-for-models-of-changing-sizes/115198 "2024-06-17T15:39:24Z")

</div>

I am solving a system of ODEs with a ContinuousCallback where once a condition!() is met, certain members of the state vector are removed (i.e., elements disappear during simulation). I would like to solve this system us…

---

## [Save and load NeuralPDE model for postprocessing](https://discourse.julialang.org/t/save-and-load-neuralpde-model-for-postprocessing/114668)

<div class="topic-metadata">

**Author:** [@PetrosStefanou](https://discourse.julialang.org/u/PetrosStefanou)\
**Replies:** 3\
**Last updated:** [June 17, 2024, 9:10am UTC](https://discourse.julialang.org/t/save-and-load-neuralpde-model-for-postprocessing/114668 "2024-06-17T09:10:43Z")

</div>

Hi, I want to save a trained NeuralPDE model and then load it to some other script at a later time for analysis and post-processing. In this reply it is suggested to save the trained Lux parameters stored in res.u. I a…

---

## [Visualize the points that are used for training in NeuralPDE](https://discourse.julialang.org/t/visualize-the-points-that-are-used-for-training-in-neuralpde/114666)

<div class="topic-metadata">

**Author:** [@PetrosStefanou](https://discourse.julialang.org/u/PetrosStefanou)\
**Replies:** 1\
**Last updated:** [June 15, 2024, 11:07am UTC](https://discourse.julialang.org/t/visualize-the-points-that-are-used-for-training-in-neuralpde/114666 "2024-06-15T11:07:07Z")

</div>

Hi, I would like to print and visualize the points that are being selected at each iteration by the QuasiRandomTraining strategy in NeuralPDE. I have checked the many fields of symbolic\_discretize but I cannot pinpoint…

---

## [What is the best way to modify existing or add new optimizer in Optim?](https://discourse.julialang.org/t/what-is-the-best-way-to-modify-existing-or-add-new-optimizer-in-optim/114553)

<div class="topic-metadata">

**Author:** [@PetrosStefanou](https://discourse.julialang.org/u/PetrosStefanou)\
**Replies:** 4\
**Last updated:** [May 24, 2024, 7:59am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-modify-existing-or-add-new-optimizer-in-optim/114553 "2024-05-24T07:59:24Z")

</div>

Hi everyone, I am wondering what would be the best way to modify an existing optimizer or add a totally new on in Optim. My interest is modify the update formula of the inverse Hessian approximation in BFGS algorithm. …

---

## [Incorporating structural information into Neural ODE as a Differential Equation System](https://discourse.julialang.org/t/incorporating-structural-information-into-neural-ode-as-a-differential-equation-system/113968)

<div class="topic-metadata">

**Author:** [@CurioMath](https://discourse.julialang.org/u/CurioMath)\
**Replies:** 0\
**Last updated:** [May 7, 2024, 7:48pm UTC](https://discourse.julialang.org/t/incorporating-structural-information-into-neural-ode-as-a-differential-equation-system/113968 "2024-05-07T19:48:21Z")

</div>

Can I know if we can feed the known physics information about a system, as a Differential Equation System into Neural network architecture within NeuralODE in DiffEqFlux.jl? I have referred documentation examples, but f…

---

## [Challenges in Estimating Wind Turbine Controller Using Universal Differential Equations (UDE) Approach](https://discourse.julialang.org/t/challenges-in-estimating-wind-turbine-controller-using-universal-differential-equations-ude-approach/113890)

<div class="topic-metadata">

**Author:** [@Alvaro98](https://discourse.julialang.org/u/Alvaro98)\
**Replies:** 5\
**Last updated:** [May 12, 2024, 5:05pm UTC](https://discourse.julialang.org/t/challenges-in-estimating-wind-turbine-controller-using-universal-differential-equations-ude-approach/113890 "2024-05-12T17:05:56Z")

</div>

Hello all, As part of my PhD work, I’m applying the Universal Differential Equations (UDE) approach seen in Automatically Discover Missing Physics by Embedding Machine Learning into Differential Equations · Overview of …

---

## [Troubleshooting Inverse Problem with PINNs for Wind Turbine Aerodynamics using NeuralPDE.jl](https://discourse.julialang.org/t/troubleshooting-inverse-problem-with-pinns-for-wind-turbine-aerodynamics-using-neuralpde-jl/113232)

<div class="topic-metadata">

**Author:** [@Alvaro98](https://discourse.julialang.org/u/Alvaro98)\
**Replies:** 12\
**Last updated:** [May 6, 2024, 9:46am UTC](https://discourse.julialang.org/t/troubleshooting-inverse-problem-with-pinns-for-wind-turbine-aerodynamics-using-neuralpde-jl/113232 "2024-05-06T09:46:41Z")

</div>

Hello all, I’m trying to estimate 10 parameters (c1 to c10) of an ODE representing the aerodynamic model of a wind turbine, and I’ve decided to do it via Bayesian inference using physics-informed neural networks (PINN) …

---

## [Neural ODEs: Fitting a cosine curve](https://discourse.julialang.org/t/neural-odes-fitting-a-cosine-curve/113702)

<div class="topic-metadata">

**Author:** [@bhaveshshrimali](https://discourse.julialang.org/u/bhaveshshrimali)\
**Replies:** 4\
**Last updated:** [May 2, 2024, 3:39pm UTC](https://discourse.julialang.org/t/neural-odes-fitting-a-cosine-curve/113702 "2024-05-02T15:39:51Z")

</div>

Hi everyone, I am trying to experiment with NeuralODEs and wanted to fit a simple cosine curve as an implementation exercise. I have tried experimenting the same with the solvers in torchdiffeq and diffrax but both seem…

---

## [Partial Autodiff in NN using Flux](https://discourse.julialang.org/t/partial-autodiff-in-nn-using-flux/69016)

<div class="topic-metadata">

**Author:** [@gnicolosi](https://discourse.julialang.org/u/gnicolosi)\
**Replies:** 1\
**Last updated:** [April 25, 2024, 9:17am UTC](https://discourse.julialang.org/t/partial-autodiff-in-nn-using-flux/69016 "2024-04-25T09:17:12Z")

</div>

I have been using Flux to model a NN which has a loss function dependent on its own NN output and other functions that contains functions also dependent on the output of the NN, in a sort of recurrent way. My data is jus…

---

## [Adding external parameters to neural network](https://discourse.julialang.org/t/adding-external-parameters-to-neural-network/112968)

<div class="topic-metadata">

**Author:** [@KianH](https://discourse.julialang.org/u/KianH)\
**Replies:** 5\
**Last updated:** [April 24, 2024, 3:03pm UTC](https://discourse.julialang.org/t/adding-external-parameters-to-neural-network/112968 "2024-04-24T15:03:41Z")

</div>

Is there any way in Lux.jl or Flux.jl to create a function for a UDE and add some parameter, for instance the parameter c in the function rhs!(...) to a neural network so that the parameter c is also estimated through th…

---

## [ODEProblem(....) vs NeuralODE(....) for neural ODEs](https://discourse.julialang.org/t/odeproblem-vs-neuralode-for-neural-odes/112670)

<div class="topic-metadata">

**Author:** [@KianH](https://discourse.julialang.org/u/KianH)\
**Replies:** 14\
**Last updated:** [April 15, 2024, 2:16pm UTC](https://discourse.julialang.org/t/odeproblem-vs-neuralode-for-neural-odes/112670 "2024-04-15T14:16:22Z")

</div>

Hello! I am wondering about the difference when using ODEProblem(....) from DifferentialEquations.jl and NeuralODE(....) from DiffEqFlux.jl in terms of time performance. Consider the code below, thus, definining the …

---

## [Continue solving ODE problem when using NeuralPDE.NNODE](https://discourse.julialang.org/t/continue-solving-ode-problem-when-using-neuralpde-nnode/101580)

<div class="topic-metadata">

**Author:** [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)\
**Replies:** 2\
**Last updated:** [April 7, 2024, 5:12pm UTC](https://discourse.julialang.org/t/continue-solving-ode-problem-when-using-neuralpde-nnode/101580 "2024-04-07T17:12:27Z")

</div>

I tried to continue solving by using the previous weight as the initial weight for the new one. But the loss for the first iteration of the new one is higher than the final loss of the previous one. My code is below: u…

---

## [NN Getting Same Training and Testing Accuracies?](https://discourse.julialang.org/t/nn-getting-same-training-and-testing-accuracies/111952)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 20\
**Last updated:** [March 24, 2024, 5:22pm UTC](https://discourse.julialang.org/t/nn-getting-same-training-and-testing-accuracies/111952 "2024-03-24T17:22:13Z")

</div>

Hi folks, Background: I am having a bit of trouble training a deep neural network. My data is comprised of grayscale images with a dimension of 128x128. For training data, I have 128x128x5116 images and for testing data…

---

## [How can I solve complex-valued ordinary differential equations (ODEs) using neural networks, given limitations with complex data types in libraries like Lux?](https://discourse.julialang.org/t/how-can-i-solve-complex-valued-ordinary-differential-equations-odes-using-neural-networks-given-limitations-with-complex-data-types-in-libraries-like-lux/110581)

<div class="topic-metadata">

**Author:** [@sahakyan2003](https://discourse.julialang.org/u/sahakyan2003)\
**Replies:** 2\
**Last updated:** [February 22, 2024, 5:56pm UTC](https://discourse.julialang.org/t/how-can-i-solve-complex-valued-ordinary-differential-equations-odes-using-neural-networks-given-limitations-with-complex-data-types-in-libraries-like-lux/110581 "2024-02-22T17:56:50Z")

</div>

Here I describe the code where I want to train the neural network but face the problem Here are the libraries I use. using NeuralPDE using DifferentialEquations using Plots using Lux, Random The function system\_of\_de! …

---

## [Solve y'=y with neuralode](https://discourse.julialang.org/t/solve-y-y-with-neuralode/109993)

<div class="topic-metadata">

**Author:** [@ATR](https://discourse.julialang.org/u/ATR)\
**Replies:** 6\
**Last updated:** [February 10, 2024, 6:33pm UTC](https://discourse.julialang.org/t/solve-y-y-with-neuralode/109993 "2024-02-10T18:33:38Z")

</div>

Dear all, I am beginner in this topic and trying to solve simple y’=y (analytical solution: exp(t)) with y0=0 by modifying code on Neural Ordinary Differential Equations · DiffEqFlux.jl (sciml.ai), my code until now: be…

---

## [Having issues with running NeuralPDE on GPU](https://discourse.julialang.org/t/having-issues-with-running-neuralpde-on-gpu/108581)

<div class="topic-metadata">

**Author:** [@tajimura](https://discourse.julialang.org/u/tajimura)\
**Replies:** 5\
**Last updated:** [January 22, 2024, 9:49am UTC](https://discourse.julialang.org/t/having-issues-with-running-neuralpde-on-gpu/108581 "2024-01-22T09:49:58Z")

</div>

Was trying to train a PINN for NLSE using NeuralPDE. Everything runs fine on CPU, but when I try to move calculations to GPU, I get the following error: ERROR: CuArray only supports element types that are allocated inli…

---

## [Flux loss with contribution gradient is slow](https://discourse.julialang.org/t/flux-loss-with-contribution-gradient-is-slow/107956)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 5\
**Last updated:** [December 27, 2023, 5:20am UTC](https://discourse.julialang.org/t/flux-loss-with-contribution-gradient-is-slow/107956 "2023-12-27T05:20:29Z")

</div>

I am trying to replicate some computations on solving PDEs with neural networks (the committor problem, see \[1802.10275\] Solving for high dimensional committor functions using artificial neural networks). This involves …

---

## [Issues with computing gradient with ForwardDiff.jl (Any fixes other than ND?)](https://discourse.julialang.org/t/issues-with-computing-gradient-with-forwarddiff-jl-any-fixes-other-than-nd/107989)

<div class="topic-metadata">

**Author:** [@ayushinav](https://discourse.julialang.org/u/ayushinav)\
**Replies:** 2\
**Last updated:** [December 24, 2023, 4:30am UTC](https://discourse.julialang.org/t/issues-with-computing-gradient-with-forwarddiff-jl-any-fixes-other-than-nd/107989 "2023-12-24T04:30:06Z")

</div>

When training a model using the boundary loss function, how do you all compute gradients? We can easily apply numerical differentiaion and get things up and running and I’ve seen a good example here. The Flux.gradient(.…

---

## ["None Sym BasicSymbolic doesn't have a name" Problem when using NeuralPDE](https://discourse.julialang.org/t/none-sym-basicsymbolic-doesnt-have-a-name-problem-when-using-neuralpde/100348)

<div class="topic-metadata">

**Author:** [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)\
**Replies:** 1\
**Last updated:** [December 20, 2023, 6:25pm UTC](https://discourse.julialang.org/t/none-sym-basicsymbolic-doesnt-have-a-name-problem-when-using-neuralpde/100348 "2023-12-20T18:25:13Z")

</div>

I try to use NeuralPDE to solve ODE problem, when I define the system with the separate variable u1(…) and u2(…) it run normally. (The code following) using NeuralPDE, Lux, ModelingToolkit, Optimization, OptimizationOpt…

---

## [PINN in Julia](https://discourse.julialang.org/t/pinn-in-julia/107771)

<div class="topic-metadata">

**Author:** [@gagankaushikmanyam](https://discourse.julialang.org/u/gagankaushikmanyam)\
**Replies:** 0\
**Last updated:** [December 18, 2023, 2:11pm UTC](https://discourse.julialang.org/t/pinn-in-julia/107771 "2023-12-18T14:11:36Z")

</div>

Hello Flux Experts /Users I have been working recently with Flux.jl in Julia and have been trying to code an ANN that uses strain (from FEM as input to the ANN) and then calculates the residual based on the output of th…

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

[Next page](https://discourse.julialang.org/tag/neural-network/654.md?match_all_tags=true&page=2&tags%5B%5D=neural-network)
