In [1]:
%load_ext autoreload
%autoreload 2

import cPickle as pickle
import os; import sys; sys.path.append('..')
import gp
import gp.nets as nets

from nolearn.lasagne.visualize import plot_loss
from nolearn.lasagne.visualize import plot_conv_weights
from nolearn.lasagne.visualize import plot_conv_activity
from nolearn.lasagne.visualize import plot_occlusion

from matplotlib.pyplot import imshow
import matplotlib.pyplot as plt
%matplotlib inline


Using gpu device 0: GeForce GTX TITAN (CNMeM is disabled, CuDNN 4007)
/home/d/nolearn/local/lib/python2.7/site-packages/theano/tensor/signal/downsample.py:6: UserWarning: downsample module has been moved to the theano.tensor.signal.pool module.
  "downsample module has been moved to the theano.tensor.signal.pool module.")

In [2]:
PATCH_PATH = ('cylinder2_rgb')

In [3]:
X_train, y_train, X_test, y_test = gp.Patch.load_rgb(PATCH_PATH)


Loaded /home/d/patches//cylinder2_rgb/ in 0.154430866241 seconds.
---------------------------------------------------------------------------
MemoryError                               Traceback (most recent call last)
<ipython-input-3-85b5c04080c1> in <module>()
----> 1 X_train, y_train, X_test, y_test = gp.Patch.load_rgb(PATCH_PATH)

/home/d/Projects/gp/gp/patch.pyc in load_rgb(PATCH_PATH, patch_size, verbose)
    652       print 'Loaded', PATCH_PATH, 'in', time.time()-t0, 'seconds.'
    653 
--> 654     return training['rgb'], training_targets['targets'].astype(np.uint8), test['rgb'], test_targets['targets'].astype(np.uint8)
    655 
    656 

/home/d/nolearn/local/lib/python2.7/site-packages/numpy/lib/npyio.pyc in __getitem__(self, key)
    222                 return format.read_array(bytes,
    223                                          allow_pickle=self.allow_pickle,
--> 224                                          pickle_kwargs=self.pickle_kwargs)
    225             else:
    226                 return self.zip.read(key)

/home/d/nolearn/local/lib/python2.7/site-packages/numpy/lib/format.pyc in read_array(fp, allow_pickle, pickle_kwargs)
    659             max_read_count = BUFFER_SIZE // min(BUFFER_SIZE, dtype.itemsize)
    660 
--> 661             array = numpy.empty(count, dtype=dtype)
    662             for i in range(0, count, max_read_count):
    663                 read_count = min(max_read_count, count - i)

MemoryError: 

In [5]:
gp.Util.view_rgba(X_train[200], y_train[200])



In [6]:
cnn = nets.RGBNetPlus()


CNN configuration: 
    Our CNN with image, prob, merged_array as RGB.

    This includes dropout. This also includes more layers.
    

In [7]:
cnn = cnn.fit(X_train, y_train)


# Neural Network with 170898 learnable parameters

## Layer information

  #  name      size
---  --------  --------
  0  input     3x75x75
  1  conv1     64x73x73
  2  pool1     64x36x36
  3  dropout1  64x36x36
  4  conv2     48x34x34
  5  pool2     48x17x17
  6  dropout2  48x17x17
  7  conv3     48x15x15
  8  pool3     48x7x7
  9  dropout3  48x7x7
 10  conv4     48x5x5
 11  pool4     48x2x2
 12  dropout4  48x2x2
 13  hidden5   512
 14  dropout5  512
 15  output    2

  epoch    trn loss    val loss    trn/val    valid acc  dur
-------  ----------  ----------  ---------  -----------  ------
      1     0.27873     0.24810    1.12346      0.90708  85.21s
      2     0.22028     0.21378    1.03039      0.92169  85.39s
      3     0.20895     0.19618    1.06504      0.92948  85.35s
      4     0.20218     0.18869    1.07149      0.93113  85.54s
      5     0.19603     0.18712    1.04762      0.93278  85.19s
      6     0.19252     0.17948    1.07266      0.93471  85.36s
      7     0.18680     0.18103    1.03187      0.93485  85.81s
      8     0.18355     0.17366    1.05697      0.93760  85.25s
      9     0.18008     0.17935    1.00404      0.93499  85.89s
     10     0.17775     0.17329    1.02572      0.93753  85.70s
     11     0.17482     0.16781    1.04179      0.93904  85.53s
     12     0.17185     0.16516    1.04050      0.94083  85.55s
     13     0.16969     0.16125    1.05236      0.94227  85.48s
     14     0.16738     0.15513    1.07893      0.94365  85.47s
     15     0.16517     0.15445    1.06935      0.94370  85.33s
     16     0.16307     0.15639    1.04275      0.94255  88.01s
     17     0.15990     0.15819    1.01080      0.94285  88.01s
     18     0.15896     0.15170    1.04790      0.94440  87.99s
     19     0.15779     0.15301    1.03126      0.94463  88.01s
     20     0.15562     0.14927    1.04253      0.94667  88.06s
     21     0.15482     0.14582    1.06171      0.94775  87.97s
     22     0.15275     0.14795    1.03241      0.94587  88.04s
     23     0.15160     0.14472    1.04755      0.94837  88.10s
     24     0.14991     0.14482    1.03513      0.94713  87.98s
     25     0.14916     0.14039    1.06246      0.94989  87.98s
     26     0.14720     0.13808    1.06604      0.95005  88.03s
     27     0.14622     0.14942    0.97857      0.94526  87.97s
     28     0.14548     0.14103    1.03159      0.95000  87.96s
     29     0.14381     0.14236    1.01016      0.94883  87.96s
     30     0.14271     0.13701    1.04157      0.95035  87.97s
     31     0.14201     0.13296    1.06806      0.95287  88.03s
     32     0.14151     0.13404    1.05570      0.95183  88.03s
     33     0.14043     0.14000    1.00312      0.95060  87.92s
     34     0.13968     0.13116    1.06492      0.95236  87.94s
     35     0.13935     0.13645    1.02123      0.94975  87.90s
     36     0.13744     0.13205    1.04083      0.95278  87.90s
     37     0.13860     0.13221    1.04836      0.95293  87.90s
     38     0.13679     0.13110    1.04339      0.95293  87.91s
     39     0.13643     0.12808    1.06517      0.95435  87.95s
     40     0.13472     0.12677    1.06273      0.95628  88.00s
     41     0.13432     0.12534    1.07166      0.95654  87.98s
     42     0.13399     0.13469    0.99477      0.95135  88.00s
     43     0.13286     0.12418    1.06986      0.95598  87.91s
     44     0.13330     0.12261    1.08721      0.95658  88.51s
     45     0.13157     0.12413    1.06000      0.95603  88.21s
     46     0.13216     0.12720    1.03895      0.95440  87.91s
     47     0.13219     0.12497    1.05773      0.95557  87.95s
     48     0.12981     0.12224    1.06190      0.95639  87.89s
     49     0.13045     0.11843    1.10149      0.95834  87.93s
     50     0.13020     0.12251    1.06277      0.95713  88.01s
     51     0.12953     0.12313    1.05193      0.95779  87.97s
     52     0.12875     0.13102    0.98264      0.95271  87.94s
     53     0.12982     0.11812    1.09902      0.95880  88.01s
     54     0.12883     0.13252    0.97212      0.95328  87.98s
     55     0.12780     0.11614    1.10041      0.95873  88.00s
     56     0.12697     0.12227    1.03841      0.95660  87.91s
     57     0.12640     0.12053    1.04872      0.95805  87.96s
     58     0.12676     0.11708    1.08272      0.95850  87.90s
     59     0.12671     0.11728    1.08040      0.95803  87.91s
     60     0.12536     0.11572    1.08328      0.95991  87.90s
     61     0.12638     0.11775    1.07330      0.95832  88.11s
     62     0.12479     0.11929    1.04612      0.95924  88.01s
     63     0.12464     0.11665    1.06851      0.95825  87.97s
     64     0.12448     0.11715    1.06252      0.95825  88.03s
     65     0.12422     0.11772    1.05525      0.95835  87.97s
     66     0.12473     0.11723    1.06398      0.95747  87.95s
     67     0.12333     0.10759    1.14625      0.96266  87.95s
     68     0.12308     0.10927    1.12638      0.96219  87.97s
     69     0.12341     0.10928    1.12930      0.96059  88.05s
     70     0.12205     0.11428    1.06803      0.95933  87.91s
     71     0.12139     0.10694    1.13509      0.96304  87.96s
     72     0.12248     0.11420    1.07248      0.95848  88.00s
     73     0.12090     0.10778    1.12174      0.96204  87.97s
     74     0.12179     0.11176    1.08977      0.96068  87.94s
     75     0.12174     0.10840    1.12306      0.96084  87.97s
     76     0.11956     0.11055    1.08150      0.96094  87.96s
     77     0.12128     0.11066    1.09591      0.96190  87.93s
     78     0.12193     0.12199    0.99955      0.95511  87.91s
     79     0.11955     0.11008    1.08601      0.96249  88.06s
     80     0.11889     0.10867    1.09409      0.96112  87.78s
     81     0.12036     0.10981    1.09613      0.95910  88.40s
     82     0.11815     0.10691    1.10516      0.96194  87.97s
     83     0.11913     0.10299    1.15676      0.96304  88.10s
     84     0.12028     0.10571    1.13787      0.96311  88.38s
     85     0.11984     0.10599    1.13065      0.96240  88.20s
     86     0.12083     0.11013    1.09712      0.96027  88.18s
     87     0.11944     0.10531    1.13415      0.96314  88.24s
     88     0.11928     0.10611    1.12418      0.96341  88.14s
     89     0.11856     0.10435    1.13615      0.96295  88.16s
     90     0.11754     0.10387    1.13163      0.96328  87.86s
     91     0.11918     0.10522    1.13266      0.96265  87.79s
     92     0.12018     0.11795    1.01892      0.95818  87.74s
     93     0.11932     0.10478    1.13879      0.96362  87.84s
     94     0.11769     0.11232    1.04774      0.95866  87.89s
     95     0.11661     0.12023    0.96990      0.95466  87.82s
     96     0.11826     0.10466    1.12997      0.96348  87.84s
     97     0.11685     0.10239    1.14119      0.96396  87.81s
     98     0.11778     0.10560    1.11529      0.96250  87.82s
     99     0.11739     0.10404    1.12830      0.96371  87.80s
    100     0.11740     0.10840    1.08304      0.96229  87.75s
    101     0.11804     0.10348    1.14074      0.96334  87.93s
    102     0.11711     0.11157    1.04969      0.95921  87.79s
    103     0.11746     0.11358    1.03422      0.95942  87.79s
    104     0.11670     0.11401    1.02362      0.95727  87.75s
    105     0.11728     0.10741    1.09189      0.96020  87.80s
    106     0.11614     0.10605    1.09508      0.96123  87.76s
    107     0.11614     0.11139    1.04267      0.95889  87.81s
    108     0.11693     0.10825    1.08020      0.96197  87.75s
    109     0.11699     0.10569    1.10684      0.96224  87.79s
    110     0.11614     0.10662    1.08923      0.96362  87.86s
    111     0.11670     0.10488    1.11271      0.96148  87.82s
    112     0.11533     0.10844    1.06359      0.95880  88.05s
    113     0.11553     0.10357    1.11557      0.96245  88.14s
    114     0.11588     0.10877    1.06534      0.96066  88.17s
    115     0.11504     0.10295    1.11740      0.96203  88.19s
    116     0.11445     0.11089    1.03213      0.95846  88.11s
    117     0.11585     0.11174    1.03679      0.95832  87.96s
    118     0.11523     0.10163    1.13376      0.96426  88.14s
    119     0.11479     0.10017    1.14597      0.96446  88.46s
    120     0.11556     0.10223    1.13043      0.96376  87.67s
    121     0.11522     0.11072    1.04061      0.95905  87.73s
    122     0.11562     0.10751    1.07548      0.96094  87.73s
    123     0.11472     0.10589    1.08345      0.96259  87.77s
    124     0.11380     0.10267    1.10835      0.96323  87.81s
    125     0.11361     0.10009    1.13502      0.96302  87.71s
    126     0.11414     0.10427    1.09468      0.96169  87.72s
    127     0.11391     0.10139    1.12358      0.96313  87.70s
    128     0.11353     0.10267    1.10572      0.96155  87.70s
    129     0.11449     0.10288    1.11277      0.96231  87.76s
    130     0.11382     0.10352    1.09953      0.96176  87.66s
    131     0.11229     0.09834    1.14183      0.96561  87.70s
    132     0.11387     0.10316    1.10388      0.96172  87.68s
    133     0.11395     0.09652    1.18049      0.96706  87.80s
    134     0.11275     0.10374    1.08684      0.96204  87.67s
    135     0.11410     0.09922    1.14994      0.96421  87.78s
    136     0.11186     0.09727    1.14997      0.96504  87.67s
    137     0.11306     0.10658    1.06079      0.95990  87.71s
    138     0.11324     0.11294    1.00265      0.95763  87.72s
    139     0.11259     0.10676    1.05464      0.95903  87.74s
    140     0.11319     0.10458    1.08233      0.96100  87.67s
    141     0.11388     0.10107    1.12669      0.96291  87.76s
    142     0.11374     0.09748    1.16683      0.96564  87.89s
    143     0.11160     0.09714    1.14885      0.96520  88.05s
    144     0.11273     0.10164    1.10907      0.96398  88.11s
    145     0.11269     0.09863    1.14257      0.96188  88.06s
    146     0.11333     0.10072    1.12523      0.96298  88.06s
    147     0.11225     0.10062    1.11562      0.96336  88.18s
    148     0.11279     0.09849    1.14515      0.96421  88.09s
    149     0.11223     0.09417    1.19178      0.96678  87.78s
    150     0.11246     0.10348    1.08677      0.96282  87.80s
    151     0.11390     0.09674    1.17731      0.96543  87.77s
    152     0.11126     0.10163    1.09474      0.96181  87.72s
    153     0.11333     0.10610    1.06810      0.96153  87.71s
    154     0.11340     0.10453    1.08487      0.96018  87.85s
    155     0.11220     0.09665    1.16081      0.96577  87.75s
    156     0.11291     0.09826    1.14919      0.96477  88.48s
    157     0.11104     0.09501    1.16870      0.96554  87.66s
    158     0.11170     0.09877    1.13096      0.96375  87.63s
    159     0.11054     0.09419    1.17360      0.96577  87.63s
    160     0.11267     0.09678    1.16410      0.96426  87.67s
    161     0.11188     0.10307    1.08548      0.96192  87.65s
    162     0.11354     0.09650    1.17665      0.96460  87.62s
    163     0.11099     0.09911    1.11982      0.96389  87.70s
    164     0.11342     0.10436    1.08677      0.95995  87.65s
    165     0.11273     0.10274    1.09730      0.96153  87.84s
    166     0.11107     0.09575    1.15991      0.96454  88.01s
    167     0.11032     0.09792    1.12663      0.96440  87.67s
    168     0.11281     0.10221    1.10364      0.96437  87.89s
    169     0.11233     0.09512    1.18090      0.96490  88.03s
    170     0.11176     0.09817    1.13849      0.96398  88.16s
    171     0.11111     0.09643    1.15230      0.96744  87.83s
    172     0.11069     0.09861    1.12248      0.96323  87.67s
    173     0.11183     0.09406    1.18899      0.96713  87.74s
    174     0.11125     0.10226    1.08788      0.96109  87.71s
    175     0.11212     0.09774    1.14707      0.96481  87.60s
    176     0.11116     0.09206    1.20751      0.96735  87.72s
    177     0.11129     0.09769    1.13926      0.96405  87.66s
    178     0.11172     0.10101    1.10600      0.96279  87.68s
    179     0.11136     0.10132    1.09911      0.96247  87.66s
    180     0.10992     0.09109    1.20678      0.96873  87.66s
    181     0.11181     0.10102    1.10674      0.96291  87.67s
    182     0.11094     0.09705    1.14318      0.96442  87.66s
    183     0.11084     0.09992    1.10923      0.96238  87.64s
    184     0.11037     0.09826    1.12319      0.96483  87.68s
    185     0.11168     0.09477    1.17841      0.96628  87.60s
    186     0.11068     0.09943    1.11317      0.96256  87.73s
    187     0.10973     0.09934    1.10460      0.96295  87.73s
    188     0.11091     0.09932    1.11668      0.96344  87.78s
    189     0.11029     0.09700    1.13712      0.96410  87.62s
    190     0.10987     0.09851    1.11527      0.96357  87.68s
    191     0.11203     0.09808    1.14230      0.96259  87.67s
    192     0.11056     0.09770    1.13166      0.96344  87.61s
    193     0.10879     0.09858    1.10358      0.96435  88.25s
    194     0.10996     0.10071    1.09186      0.96194  87.54s
    195     0.10979     0.10038    1.09373      0.96204  87.53s
    196     0.11133     0.09382    1.18663      0.96586  87.46s
    197     0.11033     0.10253    1.07608      0.96105  87.40s
    198     0.10918     0.09598    1.13749      0.96437  87.29s
    199     0.11217     0.09665    1.16058      0.96359  87.30s
    200     0.11061     0.09704    1.13982      0.96543  87.30s
    201     0.11160     0.09970    1.11932      0.96231  87.30s
    202     0.11154     0.09351    1.19284      0.96513  87.28s
    203     0.10879     0.09594    1.13391      0.96520  87.26s
    204     0.10833     0.09741    1.11203      0.96355  87.30s
    205     0.10936     0.09755    1.12109      0.96265  87.28s
    206     0.11006     0.10119    1.08770      0.96041  87.24s
    207     0.11089     0.09190    1.20665      0.96767  87.27s
    208     0.10975     0.10024    1.09491      0.96130  87.31s
    209     0.11088     0.09741    1.13828      0.96272  87.25s
    210     0.10963     0.09351    1.17238      0.96534  87.31s
    211     0.10961     0.09893    1.10796      0.96392  87.27s
    212     0.10896     0.09567    1.13887      0.96580  87.27s
    213     0.11136     0.10210    1.09068      0.96075  87.27s
    214     0.11019     0.09670    1.13946      0.96509  87.25s
    215     0.11018     0.10514    1.04792      0.95850  87.37s
    216     0.10962     0.10262    1.06817      0.96052  87.24s
    217     0.10997     0.09629    1.14202      0.96538  87.37s
    218     0.11016     0.09568    1.15144      0.96470  87.29s
    219     0.10899     0.09122    1.19492      0.96887  87.28s
    220     0.11012     0.09870    1.11569      0.96226  87.28s
    221     0.11060     0.10767    1.02720      0.95788  87.27s
    222     0.10932     0.09036    1.20980      0.96653  87.25s
    223     0.11104     0.09686    1.14632      0.96339  89.34s
    224     0.10962     0.09760    1.12313      0.96396  89.53s
    225     0.10974     0.09269    1.18393      0.96788  87.17s
    226     0.11045     0.09986    1.10603      0.96376  88.87s
    227     0.10903     0.10089    1.08064      0.96101  91.11s
    228     0.11160     0.09985    1.11764      0.96330  90.98s
    229     0.10979     0.10216    1.07471      0.96027  91.10s
    230     0.10959     0.09297    1.17883      0.96607  91.04s
    231     0.10980     0.09335    1.17621      0.96626  91.15s
    232     0.10899     0.09292    1.17298      0.96635  90.92s
    233     0.10925     0.09832    1.11117      0.96380  91.13s
    234     0.10945     0.09876    1.10822      0.96382  91.08s
    235     0.11001     0.10460    1.05169      0.96321  91.31s
    236     0.10871     0.09710    1.11950      0.96430  91.12s
    237     0.11033     0.08782    1.25624      0.96836  91.04s
    238     0.11034     0.10451    1.05580      0.95747  91.18s
    239     0.10864     0.09363    1.16022      0.96543  91.15s
    240     0.11002     0.09937    1.10714      0.96254  91.05s
    241     0.11008     0.09282    1.18598      0.96559  91.01s
    242     0.10974     0.09102    1.20569      0.96609  91.26s
    243     0.10959     0.08955    1.22378      0.96722  91.01s
    244     0.10915     0.09057    1.20510      0.96680  91.02s
    245     0.10927     0.09838    1.11067      0.96160  91.04s
    246     0.11064     0.09091    1.21705      0.96618  91.33s
    247     0.10952     0.09396    1.16555      0.96548  91.24s
    248     0.10990     0.09016    1.21892      0.96713  91.32s
    249     0.10953     0.09599    1.14114      0.96396  90.82s
    250     0.10793     0.09366    1.15232      0.96607  91.18s
    251     0.10817     0.09580    1.12912      0.96485  90.89s
    252     0.10798     0.08925    1.20978      0.96889  91.01s
    253     0.10747     0.09204    1.16759      0.96720  90.96s
    254     0.10872     0.09079    1.19752      0.96596  90.60s
    255     0.10800     0.09467    1.14078      0.96579  91.04s
    256     0.10945     0.09296    1.17734      0.96657  90.97s
    257     0.10987     0.09352    1.17475      0.96422  91.04s
    258     0.10943     0.10105    1.08293      0.96185  91.02s
    259     0.10830     0.09405    1.15148      0.96444  90.95s
    260     0.10867     0.09113    1.19251      0.96579  90.86s
    261     0.10933     0.09158    1.19385      0.96628  91.11s
    262     0.10870     0.08697    1.24984      0.96903  90.68s
    263     0.10863     0.09234    1.17643      0.96598  90.86s
    264     0.10833     0.09010    1.20231      0.96612  90.88s
    265     0.10977     0.09423    1.16486      0.96302  91.33s
    266     0.10903     0.09155    1.19095      0.96612  91.13s
    267     0.10865     0.10031    1.08317      0.96059  91.14s
    268     0.10922     0.09361    1.16679      0.96502  90.98s
    269     0.10919     0.09764    1.11834      0.96188  90.99s
    270     0.10822     0.08652    1.25083      0.96857  91.08s
    271     0.10663     0.09375    1.13738      0.96511  90.76s
    272     0.10768     0.09264    1.16239      0.96566  90.46s
    273     0.10856     0.09083    1.19528      0.96637  90.66s
    274     0.10833     0.09551    1.13432      0.96408  90.78s
    275     0.10991     0.09381    1.17164      0.96472  91.04s
    276     0.10919     0.09545    1.14396      0.96229  90.96s
    277     0.10876     0.08902    1.22178      0.96799  91.18s
    278     0.10942     0.09653    1.13354      0.96362  90.98s
    279     0.10819     0.09556    1.13223      0.96385  90.88s
    280     0.10834     0.09020    1.20111      0.96602  90.98s
    281     0.10831     0.09489    1.14147      0.96323  91.12s
    282     0.10758     0.08662    1.24196      0.96811  91.29s
    283     0.10981     0.08798    1.24806      0.96924  90.83s
    284     0.10970     0.09177    1.19535      0.96541  90.84s
    285     0.10781     0.09365    1.15121      0.96327  91.16s
    286     0.10824     0.09625    1.12453      0.96259  90.28s
    287     0.10926     0.10000    1.09255      0.96075  90.41s
    288     0.10988     0.08572    1.28181      0.96960  90.56s
    289     0.10998     0.09504    1.15725      0.96472  90.86s
    290     0.10821     0.09525    1.13605      0.96433  90.85s
    291     0.10839     0.08858    1.22359      0.96660  90.98s
    292     0.10852     0.09876    1.09880      0.96011  90.87s
    293     0.11037     0.09029    1.22245      0.96529  91.06s
    294     0.10643     0.09127    1.16620      0.96566  91.01s
    295     0.10767     0.09258    1.16302      0.96561  91.00s
    296     0.10908     0.09562    1.14076      0.96368  90.82s
    297     0.10814     0.09652    1.12040      0.96297  90.86s
    298     0.10895     0.08925    1.22074      0.96655  90.80s
    299     0.10647     0.09604    1.10862      0.96371  90.72s
    300     0.10940     0.08920    1.22638      0.96717  90.86s
    301     0.10835     0.09169    1.18165      0.96634  90.62s
    302     0.10674     0.09938    1.07400      0.96234  90.75s
    303     0.10892     0.08941    1.21817      0.96557  90.93s
    304     0.10888     0.09026    1.20628      0.96648  90.75s
    305     0.10746     0.09705    1.10730      0.96321  90.95s
    306     0.10860     0.09380    1.15786      0.96462  90.84s
    307     0.10750     0.09228    1.16485      0.96430  90.80s
    308     0.10952     0.09123    1.20047      0.96582  90.81s
    309     0.10712     0.09750    1.09858      0.96133  90.87s
    310     0.10819     0.09132    1.18470      0.96566  90.66s
    311     0.10846     0.09156    1.18452      0.96589  90.98s
    312     0.10945     0.09141    1.19729      0.96655  90.72s
    313     0.10669     0.09996    1.06735      0.96011  90.63s
    314     0.10925     0.09559    1.14286      0.96376  90.54s
    315     0.10755     0.08935    1.20364      0.96660  90.76s
    316     0.10751     0.09516    1.12975      0.96325  90.77s
    317     0.10839     0.09289    1.16691      0.96552  90.81s
    318     0.10755     0.09451    1.13803      0.96403  90.65s
    319     0.10715     0.09014    1.18862      0.96653  90.70s
    320     0.10783     0.09141    1.17957      0.96545  90.81s
    321     0.10717     0.09161    1.16992      0.96609  90.89s
    322     0.11064     0.10749    1.02929      0.95756  90.81s
    323     0.10752     0.09273    1.15951      0.96596  91.06s
    324     0.10774     0.08995    1.19783      0.96511  90.93s
    325     0.10726     0.09406    1.14033      0.96525  91.04s
    326     0.10729     0.09083    1.18119      0.96465  90.95s
    327     0.10836     0.09002    1.20372      0.96752  90.73s
    328     0.10838     0.08840    1.22610      0.96795  90.96s
    329     0.10657     0.09304    1.14550      0.96421  90.74s
    330     0.10843     0.08852    1.22495      0.96861  91.00s
    331     0.10799     0.08800    1.22705      0.96648  90.91s
    332     0.10988     0.09074    1.21093      0.96667  90.74s
    333     0.10867     0.09046    1.20131      0.96639  90.90s
    334     0.10636     0.09243    1.15073      0.96511  90.53s
    335     0.10711     0.09199    1.16434      0.96621  90.68s
    336     0.10817     0.09087    1.19037      0.96678  90.91s
    337     0.10842     0.09990    1.08526      0.96169  90.68s
    338     0.10901     0.09471    1.15096      0.96495  90.93s
Early stopping.
Best valid loss was 0.085722 at epoch 288.
Loaded parameters to layer 'conv1' (shape 64x3x3x3).
Loaded parameters to layer 'conv1' (shape 64).
Loaded parameters to layer 'conv2' (shape 48x64x3x3).
Loaded parameters to layer 'conv2' (shape 48).
Loaded parameters to layer 'conv3' (shape 48x48x3x3).
Loaded parameters to layer 'conv3' (shape 48).
Loaded parameters to layer 'conv4' (shape 48x48x3x3).
Loaded parameters to layer 'conv4' (shape 48).
Loaded parameters to layer 'hidden5' (shape 192x512).
Loaded parameters to layer 'hidden5' (shape 512).
Loaded parameters to layer 'output' (shape 512x2).
Loaded parameters to layer 'output' (shape 2).

In [7]:
test_accuracy = cnn.score(X_test, y_test)

In [8]:
test_accuracy


Out[8]:
0.9195725534308211

In [8]:
plot_loss(cnn)


Out[8]:
<module 'matplotlib.pyplot' from '/n/home05/haehn/nolearncox/lib/python2.7/site-packages/matplotlib-1.5.2-py2.7-linux-x86_64.egg/matplotlib/pyplot.pyc'>

In [9]:
# store CNN
sys.setrecursionlimit(1000000000)
with open(os.path.expanduser('~/Projects/gp/nets/RGBPlus_FULL.p'), 'wb') as f:
  pickle.dump(cnn, f, -1)

In [ ]: