<commit_before>"""
Solves grid world using three different parameter settings for Thompson
sampling. This empirically shows the convergence of Thompson sampling regardless
of the prior misspecification.
"""

from bayesrl.environments import pomdpgw
from bayesrl.agents.thompsonsampagent_pomdp2 import ThompsonSampAgentPOMDP
from bayesrl.trial import Trial
from bayesrl.plot import Plot

# Define environment.
task = pomdpgw.GridWorld(
    pomdpgw.GridWorld.samples['larger'],
    action_error_prob=.1,
    rewards={'*': 50, 'moved': -1, 'hit-wall': -1},
    pomdp=True)

num_trials = 1

################################################################################
# Thompson Sampling<commit_msg>lalala<commit_after>"""
Solves grid world using three different parameter settings for Thompson
sampling. This empirically shows the convergence of Thompson sampling regardless
of the prior misspecification.
"""

from bayesrl.environments import pomdpgw
from bayesrl.agents.thompsonsampagent_pomdp import ThompsonSampAgentPOMDP
from bayesrl.trial import Trial
from bayesrl.plot import Plot

# Define environment.
task = pomdpgw.GridWorld(
    pomdpgw.GridWorld.samples['larger'],
    action_error_prob=.1,
    rewards={'*': 50, 'moved': -1, 'hit-wall': -1},
    pomdp=True)

num_trials = 1

################################################################################
# Thompson Sampling
{'fraction_non_alphanumeric': 0.19280575539568345, 'fraction_numerical': 0.00935251798561151, 'mean_word_length': 6.060913705583756, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '395689', 'n_tokens_mistral': 410, 'n_tokens_neox': 393, 'n_words': 115}