Skip to content

functionality similar to @named for SymbolicNeuralNetwork #89

@TorkelE

Description

@TorkelE

When using SymbolicNeuralNetwork to create a neural network to insert into a UDE, it feels natural to want the output to have the same symbolic names as the variables in which you store them (as basically is the case ofr all symbolic variables across the MTK system)

nn, theta = SymbolicNeuralNetwork(; chain, nn_name = :nn, nn_p_name = theta)

Right now this have to be done manually. However, something similar to @named used in MTk would allow

@named nn, theta = SymbolicNeuralNetwork(; chain)

with nn_name = :nn and nn_p_name = theta infered automatically. Right now, @named is used for declaring Systems, and while a check checking if it is applied to a SymbolicNeuralNetwork could be possible, it might also not make sense to overload it with other functionality.

Not sure what the best solution is. One could do a @SymbolicNeuralNetwork macro. But in this case it probably makes sense to drop the function call and directly do

@SymbolicNeuralNetwork nn, theta = chain

which works well for base, however, it might make designating additional arguments more awkward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions