forked from google-deepmind/bsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample_dqn_squarecb.py
28 lines (25 loc) · 1017 Bytes
/
sample_dqn_squarecb.py
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
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import bsuite
from bsuite.baselines import experiment
from bsuite.baselines.tf import dqn_squarecb
from bsuite.experiments import summary_analysis
from bsuite.experiments.bandit_noise import analysis as bandit_noise_analysis
from bsuite.logging import csv_load
from bsuite import sweep
import bsuite.logging
import bsuite.experiments
import warnings
import numpy as np
import pandas as pd
import plotnine as gg
print('AGENT DQN SQUARECB')
for bsuite_id in sweep.SWEEP:
# if "mnist" not in bsuite_id:
# continue
print("\nTESTING BSUITE ID", bsuite_id, type(bsuite_id))
SAVE_PATH = './logs/dqn_squarecb'
cur_env = bsuite.load_and_record(bsuite_id, save_path=SAVE_PATH, overwrite=True)
cur_ag = dqn_squarecb.default_agent(obs_spec=cur_env.observation_spec(), action_spec=cur_env.action_spec())
experiment.run(cur_ag, cur_env, num_episodes=cur_env.bsuite_num_episodes)