In [1]:
import pylearn2.utils
import pylearn2.config
import theano
import neukrill_net.dense_dataset
import neukrill_net.utils
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import holoviews as hl
%load_ext holoviews.ipython
import sklearn.metrics


Using gpu device 3: Tesla K40c
:0: FutureWarning: IPython widgets are experimental and may change in the future.
Welcome to the HoloViews IPython extension! (http://ioam.github.io/holoviews/)
Available magics: %compositor, %opts, %params, %view, %%labels, %%opts, %%view
<matplotlib.figure.Figure at 0x7f3161800b10>
<matplotlib.figure.Figure at 0x7f316181a3d0>
<matplotlib.figure.Figure at 0x7f316181a1d0>

In [2]:
def make_curves(model, *args):
    curves = None
    for c in args:
        channel = m.monitor.channels[c]
        c = c[0].upper() + c[1:]
        if not curves:
            curves = hl.Curve(zip(channel.epoch_record, channel.val_record),group=c)
        else:
            curves += hl.Curve(zip(channel.epoch_record, channel.val_record),group=c)
    return curves

We analyse a selection of models using shapefix with different numbers of convolutional layers.


In [15]:
!source ../start_script.sh 1


detected stonesoup, applying config

In [4]:
ms=[]

In [16]:
ms += pylearn2.utils.serial.load(
    "/disk/scratch/neuroglycerin/models/experiment_shapefix_1_recent.pkl")


Waiting 0.5 seconds and trying again
Waiting 1.0 seconds and trying again
Waiting 2.0 seconds and trying again
Waiting 4.0 seconds and trying again
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-16-017239595821> in <module>()
      1 ms += pylearn2.utils.serial.load(
----> 2     "/disk/scratch/neuroglycerin/models/experiment_shapefix_1_recent.pkl")

/afs/inf.ed.ac.uk/user/s11/s1145806/Documents/git/pylearn2/pylearn2/utils/serial.pyc in load(filepath, recurse_depth, retry)
    182         if not retry:
    183             reraise_as(e.__class__('Failed to open {0}'.format(filepath)))
--> 184         obj =  exponential_backoff()
    185     except ValueError:
    186         logger.exception

/afs/inf.ed.ac.uk/user/s11/s1145806/Documents/git/pylearn2/pylearn2/utils/serial.pyc in exponential_backoff()
    148             logger.info("Waiting {0} seconds and trying again".format(nsec))
    149             time.sleep(nsec)
--> 150             return load(filepath, recurse_depth + 1, retry)
    151 
    152     try:

/afs/inf.ed.ac.uk/user/s11/s1145806/Documents/git/pylearn2/pylearn2/utils/serial.pyc in load(filepath, recurse_depth, retry)
    182         if not retry:
    183             reraise_as(e.__class__('Failed to open {0}'.format(filepath)))
--> 184         obj =  exponential_backoff()
    185     except ValueError:
    186         logger.exception

/afs/inf.ed.ac.uk/user/s11/s1145806/Documents/git/pylearn2/pylearn2/utils/serial.pyc in exponential_backoff()
    148             logger.info("Waiting {0} seconds and trying again".format(nsec))
    149             time.sleep(nsec)
--> 150             return load(filepath, recurse_depth + 1, retry)
    151 
    152     try:

/afs/inf.ed.ac.uk/user/s11/s1145806/Documents/git/pylearn2/pylearn2/utils/serial.pyc in load(filepath, recurse_depth, retry)
    182         if not retry:
    183             reraise_as(e.__class__('Failed to open {0}'.format(filepath)))
--> 184         obj =  exponential_backoff()
    185     except ValueError:
    186         logger.exception

/afs/inf.ed.ac.uk/user/s11/s1145806/Documents/git/pylearn2/pylearn2/utils/serial.pyc in exponential_backoff()
    148             logger.info("Waiting {0} seconds and trying again".format(nsec))
    149             time.sleep(nsec)
--> 150             return load(filepath, recurse_depth + 1, retry)
    151 
    152     try:

/afs/inf.ed.ac.uk/user/s11/s1145806/Documents/git/pylearn2/pylearn2/utils/serial.pyc in load(filepath, recurse_depth, retry)
    182         if not retry:
    183             reraise_as(e.__class__('Failed to open {0}'.format(filepath)))
--> 184         obj =  exponential_backoff()
    185     except ValueError:
    186         logger.exception

/afs/inf.ed.ac.uk/user/s11/s1145806/Documents/git/pylearn2/pylearn2/utils/serial.pyc in exponential_backoff()
    147             nsec = 0.5 * (2.0 ** float(recurse_depth))
    148             logger.info("Waiting {0} seconds and trying again".format(nsec))
--> 149             time.sleep(nsec)
    150             return load(filepath, recurse_depth + 1, retry)
    151 

KeyboardInterrupt: 

In [ ]:
make_curves(ms[0],"valid_objective","valid_y_nll","train_y_nll")