getObjectPreferencePriors: Get priors of object preferences of the listener

Description Usage Arguments Details Value Examples

View source: R/AllUtterancesAndObjects.R

Description

Determine the priors of object preferences of the listener.

These are automatically derived from the valid utterances in the scene (i.e. derived from all features of the current objects).

Usage

1
getObjectPreferencePriors(validUtterances, currentObjects, type, uttToObjProbs)

Arguments

validUtterances

A vector of utterances that correspond to all feature values present in the current objects in the scene.

For example, it only makes sense to utter "red" in a scene if there are red objects present.

currentObjects

A vector of three values in range {1,...,27} specifying the target and the other two objectsin the scene.

The target is the first object in the vector (index = 1).

type

Is set to 0: Hard priors or >0: Soft priors with specified softness

uttToObjProbs

A matrix. The rows map each possible utterance that corresponds to each present feature value of the current objects. The columns represent the three objects in the scene.

This reflects the obedience-parameter and which objects match the respective utterance. The matrix shows the probability that a certain object is chosen following a certain utterance, that is valid in the scene. The number of rows of the matrix match the length of the validUtterances vector.

Details

This function is only used in X9

Value

A list of preference priors for all valid utterances based on the objects in the scene.

The list has as many rows as the length of the validUtterances vector + 1.

Each row in the list contains a vector of length 3, as there are three objects in the scene.

The extra row is for the case of no preferences whatsoever, i.e. uniform prior over all three objects in the scene.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
getObjectPreferencePriors(validUtterances, currentObjects, type, uttToObjProbs)

output:
[[1]]
[1] 0.85 0.077 0.077

[[2]]
[1] 0.077 0.85 0.077

[[3]]
[1] 0.077 0.077 0.85

[[4]]
[1] 0.33 0.33 0.33

[[5]]
[1] 0.33 0.33 0.33

[[6]]
[1] 0.33 0.33 0.33


Example:

To see which objects are present in the scene run:
allObjects[currentObjects,]

output:

      shape   pattern  color
[1,] "cloud"  "solid" "blue"
[2,] "circle" "solid" "blue"
[3,] "square" "solid" "blue"

The validUtterances vector: [1] 1 2 3 4 7

The rows of the list 1-6 refer to the valid utterances in the scene.

Example: 

If we take a look at row 4 of the list:
[[4]]
[1] 0.33 0.33 0.33
We can see that the preference prior of the listener is 1/3 for
each of the objects, if the utterance is "solid".
The last row (6) in the list contains a uniform prior over the present
objects in the scene.

haniaelkersh/rsa-publish-test documentation built on Jan. 31, 2021, 2:02 a.m.