@@ -13,7 +13,7 @@ export NeuralNetworkBlock, multi_layer_feed_forward
13
13
include (" utils.jl" )
14
14
15
15
"""
16
- NeuralNetworkBlock(n_input = 1, n_output = 1;
16
+ NeuralNetworkBlock(; n_input = 1, n_output = 1,
17
17
chain = multi_layer_feed_forward(n_input, n_output),
18
18
rng = Xoshiro(0),
19
19
init_params = Lux.initialparameters(rng, chain),
@@ -22,8 +22,7 @@ include("utils.jl")
22
22
23
23
Create an `ODESystem` with a neural network inside.
24
24
"""
25
- function NeuralNetworkBlock (n_input = 1 ,
26
- n_output = 1 ;
25
+ function NeuralNetworkBlock (; n_input = 1 , n_output = 1 ,
27
26
chain = multi_layer_feed_forward (n_input, n_output),
28
27
rng = Xoshiro (0 ),
29
28
init_params = Lux. initialparameters (rng, chain),
@@ -46,6 +45,12 @@ function NeuralNetworkBlock(n_input = 1,
46
45
return ude_comp
47
46
end
48
47
48
+ # added to avoid a breaking change from moving n_input & n_output in kwargs
49
+ # https://github.com/SciML/ModelingToolkitNeuralNets.jl/issues/32
50
+ function NeuralNetworkBlock (n_input, n_output = 1 ; kwargs... )
51
+ NeuralNetworkBlock (; n_input, n_output, kwargs... )
52
+ end
53
+
49
54
function lazyconvert (T, x:: Symbolics.Arr )
50
55
Symbolics. array_term (convert, T, x, size = size (x))
51
56
end
0 commit comments