animations



In [1]:
%cd /Users/balandat/Documents/Code/eclipse workspace/cont_no_regret
import ContNoRegret
from ContNoRegret.animate import save_animations
from ContNoRegret.utils import plot_snapshots
import matplotlib
import matplotlib.pyplot as plt
import pickle


/Users/balandat/Documents/Code/eclipse workspace/cont_no_regret

Extracting plotdata


In [2]:
folder = '/Users/balandat/Documents/Code/Continuous_No-Regret/results/2015-05-27_08-36/'
file = 'NIPS2_CNR_vs_Quadratic.piggl'
with open(folder+file, 'rb') as f:
    results = pickle.load(f)
results = {r.label : r for r in results}
print(list(results.keys()))


['v=1.00, ExpPot', 'v=0.05, pNormPot, $p={1.5}$', 'v=0.50, pExpPot, $p={1.5}, gamma={4}$', 'v=0.25, pNormPot, $p={1.75}$', 'v=0.50, pNormPot, $p={1.05}$', 'v=0.25, pNormPot, $p={1.5}$', 'v=1.00, pNormPot, $p={1.05}$', 'v=0.25, ExpPot', 'v=0.05, pNormPot, $p={1.05}$', 'v=0.10, pNormPot, $p={1.05}$', 'v=1.00, pExpPot, $p={1.5}, gamma={4}$', 'v=0.10, pNormPot, $p={1.75}$', 'v=0.10, pExpPot, $p={1.5}, gamma={1}$', 'v=0.50, pExpPot, $p={1.5}, gamma={1}$', 'v=0.05, ExpPot', 'v=0.50, pNormPot, $p={1.5}$', 'v=0.10, ExpPot', 'v=1.00, pExpPot, $p={1.5}, gamma={1}$', 'v=0.25, pExpPot, $p={1.5}, gamma={1}$', 'v=0.50, pNormPot, $p={1.75}$', 'v=0.05, pExpPot, $p={1.5}, gamma={1}$', 'v=0.10, pNormPot, $p={1.5}$', 'v=0.25, pNormPot, $p={1.05}$', 'v=1.00, pNormPot, $p={1.75}$', 'v=0.10, pExpPot, $p={1.5}, gamma={4}$', 'v=1.00, pNormPot, $p={1.5}$', 'v=0.25, pExpPot, $p={1.5}, gamma={4}$', 'v=0.50, ExpPot', 'v=0.05, pNormPot, $p={1.75}$', 'v=0.05, pExpPot, $p={1.5}, gamma={4}$']

In [3]:
plot_snapshots([val for val in results.values()], [10, 100, 225], show=True, directory=folder, figsize=(16,8),
               elev=30, azim=120)


/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/tight_layout.py:225: UserWarning: tight_layout : falling back to Agg renderer
  warnings.warn("tight_layout : falling back to Agg renderer")

In [7]:
results['v=0.50, pNormPot, $p={1.75}$'].problem.T


Out[7]:
250

In [ ]:
save_animations(results.values(), directory=folder)