# Activation functions in NeuralPDE

**URL:** https://discourse.julialang.org/t/activation-functions-in-neuralpde/100153
**Category:** General Usage
**Tags:** question, functions, neural-network
**Created:** [June 10, 2023, 9:35pm UTC](https://discourse.julialang.org/t/activation-functions-in-neuralpde/100153 "2023-06-10T21:35:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Ethan\_Tran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ethan_tran/32/49198_2.png) [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)
#### Post date: [June 10, 2023, 9:35pm UTC](https://discourse.julialang.org/t/activation-functions-in-neuralpde/100153/1 "2023-06-10T21:35:18Z")

</div>

Hi everyone,

I am trying to use NeuralPDE to solve ODE systems.  
I would like to ask that whether NeuralPDE provide different activation function like Softmax, Tanh or just only Sigmoid?  
If yes, how could I find the information of activation functions in NeuralPDE?

Thank you all.

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [June 10, 2023, 11:12pm UTC](https://discourse.julialang.org/t/activation-functions-in-neuralpde/100153/2 "2023-06-10T23:12:03Z")

</div>

You can use any activation function you define in Julia. Just supply it to the Lux or Flux network. See the docs of the ML library for details. Do you have an MWE you’re working on?

---

<div class="post-metadata">

### Author: ![Ethan\_Tran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ethan_tran/32/49198_2.png) [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)
#### Post date: [June 11, 2023, 12:24am UTC](https://discourse.julialang.org/t/activation-functions-in-neuralpde/100153/3 "2023-06-11T00:24:55Z")

</div>

“You can use any activation function you define in Julia”. It means I need to define the function if I want to use it?, I saw that the NeuralPDE has provide sigmoid, and I would like to explore other activation functions which is provided by NeuralPDE.  
“See the docs of the ML library for details”. I have read the tutorial for ODE and just saw the sigmoid function.  
" Do you have an MWE you’re working on". Actually I am looking for the activation function, I’ve already defined the ODE system.

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [June 11, 2023, 1:24am UTC](https://discourse.julialang.org/t/activation-functions-in-neuralpde/100153/4 "2023-06-11T01:24:06Z")

</div>

Here’s the documentation of some Flux ones:

[https://fluxml.ai/Flux.jl/stable/models/activation/](https://fluxml.ai/Flux.jl/stable/models/activation/)

But you can also define any function `f(x)` and place it as the activation function.

---

<div class="post-metadata">

### Author: ![Ethan\_Tran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ethan_tran/32/49198_2.png) [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)
#### Post date: [June 11, 2023, 2:08am UTC](https://discourse.julialang.org/t/activation-functions-in-neuralpde/100153/5 "2023-06-11T02:08:06Z")

</div>

I read the information that the NNODE just supports out-of-place form. Would the NeuralPDE solve the ODE after transform from DAEs by ModelingToolkit?

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [June 11, 2023, 3:45am UTC](https://discourse.julialang.org/t/activation-functions-in-neuralpde/100153/6 "2023-06-11T03:45:30Z")

</div>

> [@Ethan\_Tran](#):
>
> Would the NeuralPDE solve the ODE after transform from DAEs by ModelingToolkit?

At this time no but it could pretty easily add that feature. I suggest opening an issue.
