Skip to content

Support using OrderedDict for initialization, also improve error message #774

@sunxd3

Description

@sunxd3

ref TuringLang/Turing.jl#2452

Support of using NamedTuple for initial_params input was introduced in #632.

Current implementation of set_values!! , which handles the initialization, does not support initializing variables that are subsumed by a varname provided in the NamedTuple.

For example, if the model contains X[1], it won’t work if initial_params is passed as (; X = ...).

To enable this functionality, we could consider adding support for using OrderedDict.

Additionally, as mentioned in TuringLang/Turing.jl#2452 , the error message can be improved when the provided vector does not conform to AbstractVector{<:Union{Real, Missing}}.

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