Skip to content

Function to add to logp within @model Turing model  #754

@jonasmac16

Description

@jonasmac16

Following from a discussion on Slack #turing I am opening this issue to request the possibility to add to logp of sample from within Turing model defined with the macro @model and to discuss what the best implementation would look like.

Two suggestions so far where

  1. Directly adding to the logp variable like this logp += log(1.0)
  2. Having a function that handles the adding e.g. acclogpdf!(log(1.0))

@trappmartin suggested the second to be potentially the better solution as it is independent of how the logp value is reflected internally and you don't add to an "undefined" variable like in option 1.

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