Skip to content

nn_name argument does not work in SymbolicNeuralNetwork #58

@TorkelE

Description

@TorkelE

I can update the name of the neural network parameter, but not the neural network parameter itself.

# Preparation
using Lux, ModelingToolkitNeuralNets, StableRNGs, ModelingToolkit
rng = StableRNG(123)
chain = Lux.Chain(
    Lux.Dense(1 => 3, Lux.softplus, use_bias = false),
    Lux.Dense(3 => 3, Lux.softplus, use_bias = false),
    Lux.Dense(3 => 1, Lux.sigmoid_fast, use_bias = false)
)

# Default names.
NN, NN_p = SymbolicNeuralNetwork(; chain, n_input = 1, n_output = 1, rng)
ModelingToolkit.getname(NN) # :nn_name
ModelingToolkit.getname(NN_p) # :p

# Trying to set specific names.
nn_name = :custom_nn_name
nn_p_name = :custom_nn_p_name
NN, NN_p = SymbolicNeuralNetwork(; chain, n_input = 1, n_output = 1, rng, nn_name, nn_p_name)
ModelingToolkit.getname(NN) # :nn_name # Should be :custom_nn_name
ModelingToolkit.getname(NN_p) # :custom_nn_p_name
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions