from rerun import get_last_stamp, get_stamps
from smoothing import running_average, savgol_filter

import matplotlib
import matplotlib.pyplot as plt
import json

stamps = get_stamps()
# stamp = get_last_stamp()
stamp = stamps[-1]
metric_file = f"./metrics/zombie_fight_baseline_2_{stamp}.json"

with open(metric_file) as json_file:
    metrics = json.load(json_file)

fig, axs = plt.subplots(1, 3)

for key, ax in zip(metrics, axs):
    metrics[key] = metrics[key][:1000]
    ax.set_title(key + " vs episodes")
    ax.set_xlabel("episodes")
    ax.set_ylabel(key)
    ax.plot(metrics[key], label="data")
    ax.plot(savgol_filter(metrics[key], len(metrics[key]) / 2, 4), label="savgol_filter")
    ax.plot(running_average(metrics[key]), label="running_average", )
    ax.legend()

fig.set_size_inches(24.5, 13)
plt.savefig(f"./graphs/zombie_fight_baseline_2_{stamp}.png")
plt.show()

8cf2bd428600eb3909d149ac8bd6aac126a097cc
<mask token>

<mask token>
with open(metric_file) as json_file:
    metrics = json.load(json_file)
<mask token>
for key, ax in zip(metrics, axs):
    metrics[key] = metrics[key][:1000]
    ax.set_title(key + ' vs episodes')
    ax.set_xlabel('episodes')
    ax.set_ylabel(key)
    ax.plot(metrics[key], label='data')
    ax.plot(savgol_filter(metrics[key], len(metrics[key]) / 2, 4), label=
        'savgol_filter')
    ax.plot(running_average(metrics[key]), label='running_average')
    ax.legend()
fig.set_size_inches(24.5, 13)
plt.savefig(f'./graphs/zombie_fight_baseline_2_{stamp}.png')
plt.show()

<mask token>
stamps = get_stamps()
stamp = stamps[-1]
metric_file = f'./metrics/zombie_fight_baseline_2_{stamp}.json'
with open(metric_file) as json_file:
    metrics = json.load(json_file)
fig, axs = plt.subplots(1, 3)
for key, ax in zip(metrics, axs):
    metrics[key] = metrics[key][:1000]
    ax.set_title(key + ' vs episodes')
    ax.set_xlabel('episodes')
    ax.set_ylabel(key)
    ax.plot(metrics[key], label='data')
    ax.plot(savgol_filter(metrics[key], len(metrics[key]) / 2, 4), label=
        'savgol_filter')
    ax.plot(running_average(metrics[key]), label='running_average')
    ax.legend()
fig.set_size_inches(24.5, 13)
plt.savefig(f'./graphs/zombie_fight_baseline_2_{stamp}.png')
plt.show()

from rerun import get_last_stamp, get_stamps
from smoothing import running_average, savgol_filter
import matplotlib
import matplotlib.pyplot as plt
import json
stamps = get_stamps()
stamp = stamps[-1]
metric_file = f'./metrics/zombie_fight_baseline_2_{stamp}.json'
with open(metric_file) as json_file:
    metrics = json.load(json_file)
fig, axs = plt.subplots(1, 3)
for key, ax in zip(metrics, axs):
    metrics[key] = metrics[key][:1000]
    ax.set_title(key + ' vs episodes')
    ax.set_xlabel('episodes')
    ax.set_ylabel(key)
    ax.plot(metrics[key], label='data')
    ax.plot(savgol_filter(metrics[key], len(metrics[key]) / 2, 4), label=
        'savgol_filter')
    ax.plot(running_average(metrics[key]), label='running_average')
    ax.legend()
fig.set_size_inches(24.5, 13)
plt.savefig(f'./graphs/zombie_fight_baseline_2_{stamp}.png')
plt.show()

from rerun import get_last_stamp, get_stamps
from smoothing import running_average, savgol_filter

import matplotlib
import matplotlib.pyplot as plt
import json

stamps = get_stamps()
# stamp = get_last_stamp()
stamp = stamps[-1]
metric_file = f"./metrics/zombie_fight_baseline_2_{stamp}.json"

with open(metric_file) as json_file:
    metrics = json.load(json_file)

fig, axs = plt.subplots(1, 3)

for key, ax in zip(metrics, axs):
    metrics[key] = metrics[key][:1000]
    ax.set_title(key + " vs episodes")
    ax.set_xlabel("episodes")
    ax.set_ylabel(key)
    ax.plot(metrics[key], label="data")
    ax.plot(savgol_filter(metrics[key], len(metrics[key]) / 2, 4), label="savgol_filter")
    ax.plot(running_average(metrics[key]), label="running_average", )
    ax.legend()

fig.set_size_inches(24.5, 13)
plt.savefig(f"./graphs/zombie_fight_baseline_2_{stamp}.png")
plt.show()
