Venture
1 program
Added 2026-02-24T00:30:13Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit 9fbdb98af3 · authored 2026-02-24T01:31:23+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
Latent Dirichlet Allocation
Provenance: commit 9fbdb98af3 · authored 2026-02-24T01:31:23+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
;;; Copyright (c) 2015 MIT Probabilistic Computing Project.
;;;
;;; This file is part of Venture.
;;;
;;; Venture is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
;;;
;;; Venture is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with Venture. If not, see <http://www.gnu.org/licenses/>.
[define model
(lambda (n_topics vocab_size)
(do (assume n_topics ,n_topics)
(assume vocab_size ,vocab_size)
(assume alpha_document_topic (gamma 1.0 2.0))
(assume alpha_topic_word (gamma 1.0 2.0))
(assume doc
(mem (lambda (doc_id)
(make_sym_dir_cat alpha_document_topic n_topics))))
(assume topic
(mem (lambda (topic_id)
(make_sym_dir_cat alpha_topic_word vocab_size))))
(assume word
(mem (lambda (doc_id pos)
((topic ((doc doc_id)))))))]
;; TODO Generate data from the prior
[define data
(lambda (n_docs n_words_per_doc)
(for_each (arange n_docs)
(lambda (doc_id)
(for_each (arange n_words_per_doc)
(lambda (pos)
(observe (word ,doc_id ,pos) integer<0>))))))]
; Smoke test with
; venture -f lda.vnt -e 'do(model(2, 2), data(3, 4), resimulation_mh(default, one, 500))'