new register objects
state slices are now registers
def __get__(int)
def by_name(str)
✌️
This commit is contained in:
@@ -104,6 +104,9 @@ class MonitorCallback(BaseCallback):
|
||||
df = pd.DataFrame(columns=monitor.columns)
|
||||
for _, row in monitor.iterrows():
|
||||
df.loc[df.shape[0]] = row
|
||||
if df is None: # The env exited premature, we catch it.
|
||||
self.closed = True
|
||||
return
|
||||
for column in list(df.columns):
|
||||
if column != 'episode':
|
||||
df[f'{column}_roll'] = df[column].rolling(window=50).mean()
|
||||
|
||||
@@ -20,13 +20,13 @@ PALETTE = 10 * (
|
||||
)
|
||||
|
||||
|
||||
def plot(filepath, ext='png', tag='monitor', **kwargs):
|
||||
def plot(filepath, ext='png', **kwargs):
|
||||
plt.rcParams.update(kwargs)
|
||||
|
||||
plt.tight_layout()
|
||||
figure = plt.gcf()
|
||||
plt.show()
|
||||
figure.savefig(str(filepath.parent / f'{filepath.stem}_{tag}_measures.{ext}'), format=ext)
|
||||
figure.savefig(str(filepath), format=ext)
|
||||
|
||||
|
||||
def prepare_plot(filepath, results_df, ext='png', tag=''):
|
||||
|
||||
Reference in New Issue
Block a user