Open kihyukh opened 2 years ago
Thanks for the code and sample dataset. I have one last suggestion:
create_dataset.ipynb
into a standalone python file that can be run, for example, by python create_dataset.py --beta 0.8
?generate_dataset.py
, introducing pandas
library just to save as csv is not a good practice. First, it does not seem to generate a clean csv file. Second, it forces the user of the script to install pandas without really making full usage of pandas.
Before:
import pandas as pd
one_list = []
two_list = []
for one, two in data_source:
one_list.append(one)
two_list.append(two)
df = pd.dataframe(one=one_list, two=two_list) # bad: unnecessarily loads pandas and memory inefficient.
df.to_csv(file) # bad: formatting is ugly and not standard
After:
print('\t'.join(['one', 'two']), file=file) # optional header row.
for one, two in data_source:
print('\t'.join([json.dumps(one), json.dumps(two)]), file=file) # you may have to look up ways to json serialize numpy arrays
# good: memory efficient. very simple.
Done.
Follow the offline data generation method in Precup's paper to create an offline data for SUMO environment.
See page 8 of the paper for the description:
Their method:
Follow their method. But instead of using C-DMPO, use our DDQN implementation. For varying the degree of cautiousness of the agent, use different penalty factor.
Dump the final data as a tab-separated file.