+NN, p = SymbolicNeuralNetwork(; chain, n_input=2, n_output=2, rng = StableRNG(42))</code></pre><p>The NN and p are symbolic parameters that can be used later as part of a system. To change the name of the symbolic variables, use <code>nn_name</code> and <code>nn_p_name</code>. To get the predictions of the neural network, use</p><pre><code class="nohighlight hljs">pred ~ NN(input, p)</code></pre><p>where <code>pred</code> and <code>input</code> are a symbolic vector variable with the lengths <code>n_output</code> and <code>n_input</code>.</p><p>To use this outside of an equation, you can get the default values for the symbols and make a similar call</p><pre><code class="nohighlight hljs">defaults(sys)[sys.NN](input, nn_p)</code></pre><p>where <code>sys</code> is a system (e.g. <code>ODESystem</code>) that contains <code>NN</code>, <code>input</code> is a vector of <code>n_input</code> length and <code>nn_p</code> is a vector representing parameter values for the neural network.</p><p>To get the underlying Lux model you can use <code>get_network(defaults(sys)[sys.NN])</code> or</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/SciML/ModelingToolkitNeuralNets.jl/blob/8207a0a017bde0a6075e3f9e316cedec8f224e3e/src/ModelingToolkitNeuralNets.jl#L61-L98">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="ModelingToolkitNeuralNets.multi_layer_feed_forward" href="#ModelingToolkitNeuralNets.multi_layer_feed_forward"><code>ModelingToolkitNeuralNets.multi_layer_feed_forward</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">multi_layer_feed_forward(; n_input, n_output, width::Int = 4,
0 commit comments