NetworkDynamics.jl with Neural Networks

Hi, I am working on integrating Neural ODEs into network simulations using NetworkDynamics.jl and ModelingToolkitNeuralNets.jl. The Problem is NetworkDynamics.jl appears to generate duplicate symbol names when processing vector symbols.

ERROR: ArgumentError: Symbol names must be unique. There are clashes in sym, psym, outsym, obssym and insym.
Stacktrace:
 [1] _fill_defaults(T::Type, kwargs::Any)
   @ NetworkDynamics ~/.julia/packages/NetworkDynamics/Fl0Oh/src/component_functions.jl:1005
 [2] _construct_comp(::Type{VertexModel}, kwargs::Any)
   @ NetworkDynamics ~/.julia/packages/NetworkDynamics/Fl0Oh/src/component_functions.jl:589
 [3] #VertexModel#33
   @ ~/.julia/packages/NetworkDynamics/Fl0Oh/src/component_functions.jl:302 [inlined]
 [4] VertexModel(sys::System, inputs::Vector{…}, outputs::Vector{…}; verbose::Bool, name::Symbol, ff_to_constraint::Bool, extin::Nothing, kwargs::@Kwargs{})
   @ NetworkDynamicsMTKExt ~/.julia/packages/NetworkDynamics/Fl0Oh/ext/NetworkDynamicsMTKExt.jl:85

I wonder if there are any other way to create symbolic neural networks?

NetworkDynamics.jl uses custom codegen to generate the dynamical functions for the components from MTK Systems. This pipeline does not support vector variables (they are also quite fragile in pure MTK pre v11). Unfortunately, it’s not trivial to implement this. Offen, it is possible to work around that issue. What is it what you‘re trying to achieve? Do you want to put a neural net in the rhs function of a vertex or edge model? Or do you want to model the neural net itself using ND.jl

Thanks for your answer. I want to use a neural net to replace a vertex model. I am attempting to build a simple neural network directly in mtkmodel without relying on ModelingToolkitNeuralNets.jl.