In [1]:
%load_ext autoreload
%autoreload 2
In [6]:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import glob
import tabulate
import pprint
import click
import numpy as np
import pandas as pd
from ray.tune.commands import *
from nupic.research.frameworks.dynamic_sparse.common.browser import *
In [8]:
exps = ['improved_magpruning_eval1', ]
paths = [os.path.expanduser("~/nta/results/{}".format(e)) for e in exps]
df = load_many(paths)
In [9]:
df.head(5)
Out[9]:
In [10]:
# replace hebbian prine
df['hebbian_prune_perc'] = df['hebbian_prune_perc'].replace(np.nan, 0.0, regex=True)
df['weight_prune_perc'] = df['weight_prune_perc'].replace(np.nan, 0.0, regex=True)
In [11]:
df.columns
Out[11]:
In [12]:
df.shape
Out[12]:
In [13]:
df.iloc[1]
Out[13]:
In [14]:
df.groupby('model')['model'].count()
Out[14]:
Experiment Details
In [15]:
# Did any trials failed?
df[df["epochs"]<30]["epochs"].count()
Out[15]:
In [16]:
# Removing failed or incomplete trials
df_origin = df.copy()
df = df_origin[df_origin["epochs"]>=30]
df.shape
Out[16]:
In [17]:
# which ones failed?
# failed, or still ongoing?
df_origin['failed'] = df_origin["epochs"]<30
df_origin[df_origin['failed']]['epochs']
Out[17]:
In [18]:
# helper functions
def mean_and_std(s):
return "{:.3f} ± {:.3f}".format(s.mean(), s.std())
def round_mean(s):
return "{:.0f}".format(round(s.mean()))
stats = ['min', 'max', 'mean', 'std']
def agg(columns, filter=None, round=3):
if filter is None:
return (df.groupby(columns)
.agg({'val_acc_max_epoch': round_mean,
'val_acc_max': stats,
'model': ['count']})).round(round)
else:
return (df[filter].groupby(columns)
.agg({'val_acc_max_epoch': round_mean,
'val_acc_max': stats,
'model': ['count']})).round(round)
In [20]:
agg(['model'])
Out[20]:
In [22]:
agg(['on_perc', 'model'])
Out[22]:
In [24]:
agg(['weight_prune_perc', 'model'])
Out[24]:
In [ ]:
agg(['on_perc', 'pruning_early_stop', 'model'])
In [28]:
agg(['on_perc', 'pruning_early_stop', 'model'])
Out[28]:
In [29]:
agg(['pruning_early_stop'])
Out[29]:
In [32]:
agg(['model', 'pruning_early_stop'])
Out[32]:
In [30]:
agg(['on_perc', 'pruning_early_stop'])
Out[30]:
In [ ]: