NeuralPDE passing current grid point the the loss and activation funciton

Hello everyone,
i have three questions regarding the NeuralPDE package:

  • is it possible to pass the current grid point to the additional cost function? I would like to take the derivative at the boundary of the domain (I want to use it for a periodic boundary condition)
  • Is it possible to passs the current grid point to a own activation function? I would like to to multiply the last layer with the function with x_point * (x_point - l) to implement to additional bc in a diffrent way.
  • is it also possible to use residual neural networks ?

Thanks for your time.

I don’t understand how those are connected: just use the derivative in the boundary condition.

Yes, just define the neural network to be a residual neural network. Any Flux or Lux model is fine.

Yes, any Flux or Lux model is fine. So just define model([x,y]) to do this by defining a Lux/Flux model that does it.