Frank, Goodman & Tenenbaum (2009) intentional Bayesian word-learning model
Source:R/model-fgt2009.R
fgt2009.RdA joint Bayesian model that infers a lexicon – a set of word-object
edges – from the whole corpus at once, marginalizing over the speaker's
latent referential intention on each trial. Words are generated either
referentially (probability gamma, naming an object in the intention) or
non-referentially (1 - gamma, with in-lexicon words down-weighted by
kappa); a geometric prior P(L) proportional to exp(-alpha |L|) favors
small lexicons. Inference is MCMC (blocked per-object Gibbs plus MI-biased
single-edge Metropolis moves), and xslFit$matrix holds the resulting
posterior edge marginals P(word names object | corpus).
Usage
fgt2009(
alpha,
gamma = 1,
kappa = 0.5,
n_chains = 4L,
n_warmup = 120L,
n_samples = 300L,
gibbs_per = 1L,
edge_per = 1L,
top_k = 6L,
seed = 1L
)Arguments
- alpha
Geometric lexicon-size prior:
P(L)proportional toexp(-alpha |L|). Must be tuned to corpus size.- gamma
Probability that a word is used referentially.
1(the default) is appropriate when every word heard is a label, as in controlled XSL experiments.- kappa
Down-weight applied to an in-lexicon word used non-referentially (only relevant when
gamma < 1).- n_chains, n_warmup, n_samples, gibbs_per, edge_per, top_k, seed
Sampler controls. Defaults are tuned for the small, dense corpora of XSL experiments; raise
n_chains/n_samplesto reduce Monte Carlo noise.
Details
This is a batch model, unlike the incremental associative models in this
package: it has no trial-by-trial learning trajectory, and control$reps is
ignored. Ported from the Python package wordlearn
(github.com/mcfrank/wurwur); see also fgt2009_rsa() for the pragmatic
extension.
alpha scales with corpus size (larger corpora want a larger alpha) and
the fit-vs-alpha curve is single-peaked, so alpha is best chosen with a
sweep (see fgt2009_sweep_alpha()) rather than a general-purpose optimizer.
gamma and kappa default to the values used for the analogous
cross-situational simulation in the source package
(gamma = 1: every word in a controlled XSL experiment is a referential
label, so there is no non-referential channel; kappa = 0.5). The
naturalistic-speech values are gamma = 0.1, kappa = 0.05.
Examples
mod <- fgt2009(alpha = 1)
xsl_run(mod, get_example_ambiguous_condition())
#> $fits
#> $fits[[1]]
#> $fits[[1]]$sims
#> NULL
#>
#> $fits[[1]]$responses
#> 1 2 3 4
#> [1,] 0.4962917 0.4980964 0.4848676 0.5060647
#>
#> $fits[[1]]$perf
#> 1 2 3 4
#> 0.4962917 0.4980964 0.4848676 0.5060647
#>
#> $fits[[1]]$matrix
#> 1 2 3 4
#> 1 0.3343047460 0.3384679434 0.0004163197 0.0004163197
#> 2 0.3284762698 0.3268109908 0.0004163197 0.0004163197
#> 3 0.0004163197 0.0004163197 0.3201498751 0.3393005828
#> 4 0.0004163197 0.0004163197 0.3043297252 0.3126561199
#>
#> $fits[[1]]$sse
#> [1] 0.0002831451
#>
#> $fits[[1]]$data
#> xslData object with label "example condition" and condition "ambiguous"
#> training trials: 2
#> test trials: 0
#> words: 4
#> objects: 4
#> accuracies: 4
#>
#>
#>
#> $sse
#> [1] 0.0002831451
#>
#> $unweighted_sse
#> [1] 0.0002831451
#>