Top-level forms for Anglican programs
Top-level forms for Anglican programs
($conditional cont $state & condargs)
conditional returning CPS-transformed function
conditional returning CPS-transformed function
($map1 $cont $state fun lst)
map on a single sequence
map on a single sequence
($nils? $cont $state lst)
true if the list contains nil
true if the list contains nil
($reduce1 $cont $state fun init lst)
reduce with explicit init in CPS
reduce with explicit init in CPS
($repeatedly $cont $state n thunk)
repeatedly in CPS
repeatedly in CPS
(anglican & args)
macro for embedding anglican programs
macro for embedding anglican programs
(conditional query & options)
accepts an Anglican query and returns a conditional distribution defined by the query
accepts an Anglican query and returns a conditional distribution defined by the query
(def-cps-fn & args)
legacy name for defm
legacy name for defm
(defanglican name & args)
binds variable to anglican program
binds variable to anglican program
(defm name & args)
Binds a variable to an anglican function. The syntax is the same as for `defn' with a single parameter list:
(defm variable-name optional-doc-string [parameter ...]
anglican-expression ...)
A `defm' declaration is a shortcut for:
(def variable-name optional-doc-string
(fm variable-name [parameter ...]
anglican-expression ...))
Binds a variable to an anglican function. The syntax is the same as for `defn' with a single parameter list: (defm variable-name optional-doc-string [parameter ...] anglican-expression ...) A `defm' declaration is a shortcut for: (def variable-name optional-doc-string (fm variable-name [parameter ...] anglican-expression ...))
(defquery name & args)
Binds variable to an anglican query. Syntax:
(defquery variable-name optional-doc-string optional-parameter
anglican-expression ...)
A defquery declaration is a shortcut for
(def variable-name optional-doc-string
(query optional-parameter
anglican-expression ...)
Binds variable to an anglican query. Syntax: (defquery variable-name optional-doc-string optional-parameter anglican-expression ...) A defquery declaration is a shortcut for (def variable-name optional-doc-string (query optional-parameter anglican-expression ...)
(defun name & args)
binds variable to function in Anglican syntax
binds variable to function in Anglican syntax
(fm & args)
Defines an anglican function outside of anglican code. The syntax is the same as of `fn' with a single parameter list:
(fm optional-name [parameter ...] anglican-expression ...)
Defines an anglican function outside of anglican code. The syntax is the same as of `fn' with a single parameter list: (fm optional-name [parameter ...] anglican-expression ...)
(lambda & args)
defines function in Anglican syntax
defines function in Anglican syntax
(mem & args)
creates a memoized computation in CPS form
creates a memoized computation in CPS form
(query & args)
Defines an anglican query. Syntax:
(query optional-parameter anglican-expression ...)
Example:
(query (let [x (sample (normal 0 10))] (observe (normal 1 1) x) (predict x)))
query' returns a value that can be passed as the second argument to
anglican.infer/infer'. An optional parameter can
be specified and must either a symbol or a vector, in which
case the initial value passed to the query is destructured to
the parameter:
(query [mean sd] (let [x (sample (normal mean sd))] (predict x)))
Defines an anglican query. Syntax: (query optional-parameter anglican-expression ...) Example: (query (let [x (sample (normal 0 10))] (observe (normal 1 1) x) (predict x))) `query' returns a value that can be passed as the second argument to `anglican.infer/infer'. An optional parameter can be specified and must either a symbol or a vector, in which case the initial value passed to the query is destructured to the parameter: (query [mean sd] (let [x (sample (normal mean sd))] (predict x)))
(with-primitive-procedures procedures & body)
binds primitive procedure names to their CPS versions; if procedure name is qualified, it becomes unqualified in the scope of the macro
binds primitive procedure names to their CPS versions; if procedure name is qualified, it becomes unqualified in the scope of the macro
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close