Skip to content

Consider changing how update and regenerate handle default arguments. #538

@ztangent

Description

@ztangent

When I first introduced support for optional trailing arguments in the Gen dynamic modeling language (see #195), the way I added this functionality to update and regenerate was to assume that default argument vaues would always override the arguments specified in the previous trace that update or regenerate was applied to.

This behavior was easier to implement, but now that I think about it, quite unnatural: Usually, if you're running a MCMC or SMC algorithm on a trace, you want to keep any optional trailing arguments fixed, rather than having to repeatedly specify their values.

As such, I'm proposing that for any optional trailing arguments that are not explicitly specified in a call to update or regenerate, update or regenerate should keep the argument values stored in the previous trace. This would not be hard to implement. It would be a breaking change, but I don't think tons of code relies on the current default behavior because of how unnatural it is.

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