Description Usage Arguments Details Value Examples
View source: R/SRSA_UttChoiceOptimization_iterative.R
Simple RSA
Determines the optimal utterance for the best information gain.
These are based on the valid utterances determined from the current objects in the scene.
The inferred listener's object preferences are computed assuming the listener picks a certain object and has certain object preferences.
1 2 3 4 5 6 7 8 | getSimpleBestInfGainUttPreferencesIterative(
preferencesPriorAll,
currentObjects,
softPrefValue,
notObeyInst,
klValueFactor,
targetFeature
)
|
preferencesPriorAll |
A vector of length 9. Probability mass over all feature values. Gives a prior preferences distribution over all (nine) feature values. |
currentObjects |
A vector of three values in The target is the first object in the vector |
softPrefValue |
A parameter value between Value reflects how categorical the listener's preferences are: 0: The listener always picks her preferred object. If the listener prefers red objects, she will always pick the red object in the scene. infinity: It is as likely for the listener to pick green, blue or red objects. |
notObeyInst |
Determines the extent to which the instruction of the speaker is obeyed by the listener. (0 = full obedience, infinity = full instruction ignorance). Example: 0: Listener always picks red objects following the utterance "red". infinity: Listener as likely to pick green, blue or red objects even if the utterance is "red". |
klValueFactor |
A parameter that can be negative, zero or positive:
|
targetFeature |
A value between 1 and 3, specifying which feature type- color, shape, or pattern- is considered (for preferences). |
This function is only used in X9.
This is the iterative version of getSimpleBestInfGainUttPreferences
A vector containing the normalized probability over utterances given the listener's object preference priors.
The utterance with the highest probability is the one that maximizes the information gain for the speaker.
posterior preferences over feature values: 3 dimensional array for simulated preferences.
rows: utterances, columns: preferences, blocks: objects.
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 | getSimpleBestInfGainUttPreferencesIterative(preferencesPriorAll, currentObjects, softPrefValue,
notObeyInst, klValueFactor, targetFeature)
output:
[[1]]
[1] 0.25 0.25 0.25 0.00 0.00 0.25
[[2]]
, , 1
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
[1,] 0 0 0 0.3334166 0.33325 0.3333333 0 0 0
[2,] 0 0 0 0.3334166 0.33325 0.3333333 0 0 0
[3,] 0 0 0 0.3334167 0.33325 0.3333333 0 0 0
[4,] 0 0 0 0.0000000 0.00000 0.0000000 0 0 0
[5,] 0 0 0 0.0000000 0.00000 0.0000000 0 0 0
[6,] 0 0 0 0.3334166 0.33325 0.3333333 0 0 0
, , 2
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
[1,] 0 0 0 0.3334166 0.33325 0.3333333 0 0 0
[2,] 0 0 0 0.3334166 0.33325 0.3333333 0 0 0
[3,] 0 0 0 0.3334167 0.33325 0.3333333 0 0 0
[4,] 0 0 0 0.0000000 0.00000 0.0000000 0 0 0
[5,] 0 0 0 0.0000000 0.00000 0.0000000 0 0 0
[6,] 0 0 0 0.3334166 0.33325 0.3333333 0 0 0
, , 3
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
[1,] 0 0 0 0.3331667 0.3334999 0.3333333 0 0 0
[2,] 0 0 0 0.3331667 0.3334999 0.3333333 0 0 0
[3,] 0 0 0 0.3331668 0.3334999 0.3333333 0 0 0
[4,] 0 0 0 0.0000000 0.0000000 0.0000000 0 0 0
[5,] 0 0 0 0.0000000 0.0000000 0.0000000 0 0 0
[6,] 0 0 0 0.3331667 0.3334999 0.3333333 0 0 0
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.