updating function to process all expert data from track files, starting processing options policy from file
This commit is contained in:
@@ -1,28 +1,34 @@
|
||||
import tqdm
|
||||
import expert
|
||||
import copy
|
||||
import sys, os
|
||||
import os
|
||||
import intersim
|
||||
from tqdm import tqdm
|
||||
|
||||
def process_all_experts(env_args={}, policy_args={}):
|
||||
def process_all_experts(filename='expert.pkl',env_args={}, policy_args={}):
|
||||
"""
|
||||
Process all experts in the Interaction Dataset
|
||||
For now, using NormalizedIntersimpleExpert with NRasterizedIncrementingAgent environment
|
||||
|
||||
Args:
|
||||
filename (str): name for track file
|
||||
env_args (dict): default environment kwargs
|
||||
policy_args (dict): default policy kwargs
|
||||
"""
|
||||
|
||||
for loc in LOCATIONS:
|
||||
for track in TRACKS:
|
||||
I, J = len(intersim.LOCATIONS), intersim.MAX_TRACKS
|
||||
pbar = tqdm(total=I*J)
|
||||
for loc in range(I):
|
||||
for track in range(J):
|
||||
|
||||
it_env_args = copy.deepcopy(env_args)
|
||||
it_env_args.update({
|
||||
'loc':loc,
|
||||
'track':track,
|
||||
})
|
||||
|
||||
it_path = 'newpathname'
|
||||
out_folder = os.path.join(intersim.LOCATIONS[loc], 'track%04i'%(track))
|
||||
if not os.path.isdir(out_folder):
|
||||
os.makedirs(out_folder)
|
||||
it_path = os.path.join(out_folder,filename)
|
||||
|
||||
expert.demonstrations(
|
||||
expert='NormalizedIntersimpleExpert',
|
||||
@@ -31,6 +37,8 @@ def process_all_experts(env_args={}, policy_args={}):
|
||||
env_args=it_env_args,
|
||||
policy_args=policy_args,
|
||||
)
|
||||
pbar.update(1)
|
||||
pbar.close()
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
|
||||
Reference in New Issue
Block a user