In [1]:
%matplotlib inline
import numpy as np
import tensorflow as tf
import os
import matplotlib.pyplot as plt
from scipy.io import wavfile
from scipy import signal as scisig
import pickle
import sys
sys.path.append('..')
import matchingpursuit
import signalset

In [2]:
import matplotlib
matplotlib.rcParams['figure.figsize'] = (20.0, 10.0)

In [3]:
sigset = signalset.SignalSet(data='../../Data/speech_corpora/TIMIT/')


Found  6292  files

In [4]:
def smoothed(history, window_size=10, norm=1, start=0, end=-1):
        """Plots a moving average of the error and activity history with the given averaging window."""
        window = np.ones(int(window_size))/float(window_size)
        smoothederror = np.convolve(history[start:end], window, 'valid')
        plt.plot(smoothederror, 'b')

In [4]:
mp = matchingpursuit.MatchingPursuer(sigset, use_gammachirps=False)
mp.load('MPonTIMIT.pickle')


---------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)
<ipython-input-4-224e418c5373> in <module>()
      1 mp = matchingpursuit.MatchingPursuer(sigset, use_gammachirps=False)
----> 2 mp.load('MPonTIMIT.pickle')

C:\Users\Eric\Documents\Berkeley\Research\Neuroscience\Sparse coding\audition\matching-pursuit\matchingpursuit.py in load(self, filename)
    215         self.paramfile = filename
    216         with open(filename, 'rb') as f:
--> 217             self.phi, params, histories = pickle.load(f)
    218         self.set_histories(histories)
    219         self.set_params(params)

UnicodeDecodeError: 'ascii' codec can't decode byte 0x98 in position 0: ordinal not in range(128)

In [18]:
filename = 'MPonTIMIT.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')
#set_histories(histories)
#set_params(params)

In [19]:
plt.plot(histories['loss'])


Out[19]:
[<matplotlib.lines.Line2D at 0x1f2a5fb56d8>]

In [20]:
import matplotlib
matplotlib.rcParams['figure.figsize'] = (20.0, 10.0)
sigset.tiled_plot(phi)



In [3]:
filename = 'MPonTIMIT.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')
#set_histories(histories)
#set_params(params)

In [4]:
plt.plot(histories['loss'])


Out[4]:
[<matplotlib.lines.Line2D at 0x1a323582588>]

In [5]:
import matplotlib
matplotlib.rcParams['figure.figsize'] = (20.0, 10.0)
sigset.tiled_plot(phi)



In [6]:
filename = 'MPonTIMIT2.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')
#set_histories(histories)
#set_params(params)

In [7]:
plt.plot(histories['loss'])


Out[7]:
[<matplotlib.lines.Line2D at 0x1a2feb73ba8>]

In [8]:
sigset.tiled_plot(phi)



In [9]:
filename = 'MPonTIMIT3.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')
#set_histories(histories)
#set_params(params)

In [16]:
smoothed(histories['loss'],100)



In [11]:
sigset.tiled_plot(phi)



In [17]:
filename = 'MPonTIMIT4.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')

In [19]:
smoothed(histories['loss'],500)



In [20]:
sigset.tiled_plot(phi)



In [15]:
filename = 'MPonTIMIT4.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')

In [16]:
params


Out[16]:
{'learn_rate': 0.1, 'max_iter': 1000, 'min_spike': 0.1}

In [10]:
smoothed(histories['loss'],500)



In [23]:
sigset.tiled_plot(phi)



In [5]:
filename = 'MPonTIMITlowthresh.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')

In [7]:
plt.plot(histories['loss'])


Out[7]:
[<matplotlib.lines.Line2D at 0x23aa318a080>]

In [4]:
filename = 'MPonTIMIT6.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')

In [7]:
smoothed(histories['loss'],10)



In [8]:
sigset.tiled_plot(phi)



In [4]:
filename = 'MPonTIMIT7.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')

In [9]:
smoothed(histories['loss'],100)



In [8]:
sigset.tiled_plot(phi)



In [13]:
plt.plot(histories['meanacts'],'bo')


Out[13]:
[<matplotlib.lines.Line2D at 0x1fda5214240>]

In [5]:
filename = 'MPonTIMIT9.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')

In [10]:
plt.plot(histories['loss'])


Out[10]:
[<matplotlib.lines.Line2D at 0x208a681ae80>]

In [7]:
sigset.tiled_plot(phi)



In [14]:
plt.plot(histories['L1acts'],'bo')


Out[14]:
[<matplotlib.lines.Line2D at 0x208a7acc780>]

In [5]:
filename = 'MPonTIMIT10.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')

In [6]:
plt.plot(histories['loss'])


Out[6]:
[<matplotlib.lines.Line2D at 0x1e6210824a8>]

In [7]:
sigset.tiled_plot(phi)



In [8]:
plt.plot(histories['L1acts'],'bo')


Out[8]:
[<matplotlib.lines.Line2D at 0x1e625f10400>]

In [9]:
params


Out[9]:
{'learn_rate': 0.01, 'max_iter': 20000.0, 'min_spike': 0.1}

In [10]:
filename = 'MPonTIMIT2.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')
params


Out[10]:
{'learn_rate': 0.1, 'max_iter': 1000, 'min_spike': 0.1}

In [5]:
filename = 'MPonTIMIT11.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')
params


Out[5]:
{'learn_rate': 0.01, 'max_iter': 2000.0, 'min_spike': 0.1}

In [6]:
plt.plot(histories['loss'])


Out[6]:
[<matplotlib.lines.Line2D at 0x1a6240065c0>]

In [7]:
sigset.tiled_plot(phi)



In [5]:
filename = 'MPonTIMIT12.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')
params


Out[5]:
{'learn_rate': 0.01, 'max_iter': 2000.0, 'min_spike': 0.1}

In [6]:
sigset.tiled_plot(phi)



In [5]:
filename = 'MPonTIMIT13.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')

In [6]:
plt.plot(histories['loss'])


Out[6]:
[<matplotlib.lines.Line2D at 0x23fbbcb4da0>]

In [7]:
sigset.tiled_plot(phi)



In [9]:
plt.plot(histories['L1acts'], 'b.')


Out[9]:
[<matplotlib.lines.Line2D at 0x24025bdfba8>]

In [10]:
mp = matchingpursuit.MatchingPursuer(sigset, use_gammachirps=False)
mp.phi = phi

In [14]:
sigset.seg_length = 16000
signal = sigset.rand_stim()
signal.shape


Out[14]:
(16000,)

In [15]:
coeffs, xhat, resid, errors = mp.infer(signal)
plt.plot(np.squeeze(xhat), 'b', signal, 'g')


Out[15]:
[<matplotlib.lines.Line2D at 0x24027ec42b0>,
 <matplotlib.lines.Line2D at 0x24027ec4470>]

In [17]:
plt.plot(np.squeeze(xhat))


Out[17]:
[<matplotlib.lines.Line2D at 0x24028c2f940>]

In [21]:
coeffs[coeffs!=0]


Out[21]:
array([-0.19061424,  0.46953604,  0.21259068,  0.21972479, -0.41467011,
       -0.44216231,  0.26333851, -0.23036988, -0.3768141 ,  0.30878544,
        0.1951462 , -0.26301646, -0.61047167, -0.52050173, -0.54547775,
        0.27785644, -0.31983927,  0.28295463,  0.41098621,  0.39540291,
       -0.51563621,  0.25054047, -0.23618285,  0.38579887,  0.1918028 ,
       -0.32344711, -0.59490818,  0.75961757,  0.61744136, -0.76390851,
        0.41248131, -0.51126766, -0.31244153, -0.2311779 , -0.20536299,
       -0.34222513,  0.33906147,  0.82973927,  0.56222641, -0.20007645,
        0.33459741, -0.58607471, -0.46694213, -0.57828009, -0.37910879,
       -0.47023982, -0.3265101 , -0.99074024, -0.25112432, -0.22028685,
        0.78984141,  0.86626142,  1.00081897, -0.22853117, -0.2113284 ,
       -0.60167772,  0.71437103, -0.33466375, -0.48786622,  0.37441695,
       -0.22277179,  0.59035152, -0.46190551, -0.83888972, -0.37617198,
        0.65342653, -0.25388914, -0.32506433,  0.19604121, -0.72675437,
        0.91851819, -0.36791176,  1.12159491, -0.77696437,  0.49814054,
        0.29126674, -0.31100383,  0.24743362,  0.2976684 ,  0.68219995,
        0.26094481,  0.37399703,  0.37082392,  0.93201321,  0.59736735,
        0.47351906,  1.22950637, -0.19888039, -0.2079998 , -0.89672291,
       -1.09735072, -1.08030081, -0.65454918,  0.21887153,  0.75641817,
        0.41538188, -1.2095964 ,  0.25786147,  0.393529  , -0.36343834,
        0.49669039, -0.23426493, -0.44221696,  0.2746447 ,  0.86660433,
        0.27971208,  0.50178796, -1.02763104, -0.34909472,  0.57875329,
       -0.37813309, -1.21247363, -0.545008  ,  0.28428906, -0.19845313,
        1.32901204,  1.16987038,  0.61119115, -0.1917614 , -1.23268604,
        0.27447733,  0.8384276 ,  0.26325539, -0.22754446,  0.67658275,
       -0.3345007 ,  0.36437824, -0.44157335,  0.22397177,  0.53952509,
        0.35140035, -0.72444445,  0.32800511,  0.55342716,  0.22936179,
       -0.76914734, -0.60447586, -0.51209217, -0.77876812,  1.03274202,
       -1.1367923 ,  0.92650151, -0.31342912, -0.25409907,  0.68710953,
       -0.44833183,  0.51558554,  1.39650309,  0.2596578 ,  0.45397446,
       -1.23115277, -1.13284099, -0.48525882,  0.39422929,  0.36966172,
        0.99984515,  0.67360568, -0.29257202, -0.27195773, -1.06774843,
       -1.37800622,  1.01739395,  0.55025429, -0.2297906 , -0.31073812,
       -0.24732977, -0.41743353, -1.16813791,  0.19283228, -0.37158278,
        0.89337468,  0.22971326, -0.79028916, -0.38430059,  0.55846351,
        0.26194459,  0.22847302,  0.65797681,  0.87835056, -0.86013913,
        0.65315872, -0.88299608, -0.54824263,  0.66083145,  0.41154081,
        0.20744126, -0.76142299, -0.57474351, -0.31926611, -0.69816166,
        0.56998664, -0.82800108, -0.66849416,  0.4695136 ,  0.35212624,
        0.25457826, -0.34080708, -0.41684082, -0.20079266, -0.2614249 ,
       -0.24519125, -0.30207551, -0.59198064, -0.18930373, -0.25007716,
        0.40097815,  0.62565738, -0.36600387, -0.28297338, -0.21488582,
       -1.08390415, -0.83970767, -0.37274587, -0.49404672,  1.10010934,
       -0.53100157,  0.82959425,  1.29643703,  1.01393104, -1.24146307,
       -1.18474388, -1.17542267, -0.29109761, -0.60621929,  0.23283568,
        0.28143468,  0.21516596, -0.52699089,  0.46372068, -0.55988121,
       -0.3059687 , -0.52279985, -0.29688942,  0.71383148,  0.76433527,
        0.36254099, -0.63486147, -0.1997323 ,  0.51433265, -0.24488823,
       -0.21429011, -0.34241021, -0.48331541, -0.31201893,  0.50254691,
       -0.38963503,  0.33045688,  0.4024561 , -0.40797642, -0.21926472,
        0.58489859, -0.41045409, -0.61300808, -0.39038014,  0.44213068,
       -0.41580883, -0.92828465, -0.34831378, -0.2827042 ,  0.76475137,
       -0.20404914, -0.34983322,  0.23912941, -0.93349981,  0.62337422,
       -0.50310612,  1.17077279,  1.20025086,  0.27592096,  0.18960567,
        0.36128798, -0.75395495, -1.12310994, -0.53823704,  0.64274549,
        1.05432928,  0.81663471, -0.23500849, -0.33172303, -0.33099487,
        0.50488627, -0.40992722, -0.22249731, -1.14529979,  0.74859583,
        1.31994951, -0.27170083, -0.27970263, -0.27452022,  0.2551713 ,
       -0.19804525,  0.37564388,  0.70176387,  0.64174867,  0.44792771,
        0.69032437, -0.27035162,  0.37492412, -0.60303986, -0.49919862,
        1.16849744,  0.25755635,  0.83632815, -0.89626253, -1.08241129,
       -1.19004178,  0.26651117,  0.25211352, -0.32496017,  0.61781722,
        0.70931381, -0.5088132 ,  0.51582187, -0.49535242, -0.27655274,
       -0.32510951,  0.61645985, -0.23891214,  0.75222319, -0.88804549,
       -1.09517288, -0.26046929, -0.46150172,  0.19267288,  0.33279502,
        0.6573981 , -0.43430638, -0.28150618,  0.36881644,  1.07132661,
        0.85854787, -0.64647484, -0.73540092,  0.31412166,  0.37038139,
       -0.32172582,  0.52653325, -0.20320918,  0.25490355, -0.40322322,
        0.64507747, -0.47193041, -0.84284073,  0.2451549 , -0.40051123,
        0.50707942, -0.86422437,  0.85368246, -0.8449868 , -0.52877802,
        0.38319361, -0.33840784,  0.62971234, -0.37930897, -0.78886676,
        0.32849541,  0.19250846,  0.50836462, -0.28482157,  0.20140769,
        0.95728201, -0.27675593, -0.61558807, -0.73255384,  0.23938586,
        0.26536214, -0.40000474,  0.37168777,  0.39875457,  0.62003309,
        0.23730879, -0.19123651,  0.38670641, -0.22803453,  0.24726909,
        0.49872771, -0.3091656 ,  0.21490489,  0.23783724,  0.33170813,
        0.34227523,  0.61183685,  0.64187592,  0.48052603, -0.45842087,
       -0.47470072, -0.54648459,  0.29177722, -0.30217829, -0.19274165,
       -0.23414773,  0.32395348,  0.25997216, -0.20492125,  0.21536383,
        0.38657606,  0.32460079,  0.47044104,  0.45665625, -0.29938483,
        0.27638301,  0.22725371,  0.24228533,  0.27098104, -0.23897576,
        0.29522806, -0.21332182, -0.2403322 ,  0.21630765,  0.25269565,
       -0.19297086, -0.20168844,  0.26469016,  0.22749445,  0.21214433,
        0.23035087, -0.20530762, -0.22425766,  0.19916417,  0.22583866,
       -0.20635109,  0.23115809,  0.20405909,  0.2338043 , -0.20787248,
       -0.19446081, -0.19140615,  0.22794552, -0.21395165,  0.20781523,
        0.18853006, -0.2188268 , -0.24604075,  0.21153235,  0.25382066,
       -0.21489397, -0.28009284, -0.19631834,  0.28151119,  0.19285847,
        0.30465823,  0.22515094, -0.3255612 , -0.18803595, -0.32099706,
        0.22452918,  0.21465577,  0.43068856,  0.38649094, -0.20722298,
        0.25775537, -0.27555043,  0.19846582,  0.28547141, -0.36244103,
        0.22533108,  0.21658865,  0.38310173,  0.52472514,  0.46239439,
        0.31005681, -0.22423641, -0.33611798,  0.33206198, -0.20859165,
       -0.20805807,  0.24915959,  0.24756286, -0.23946437, -0.36792681,
        0.33318639, -0.21198113, -0.32340667, -0.1884409 ,  0.38942879,
        0.49003881,  0.4414469 , -0.28842467, -0.22334146,  0.24008593,
       -0.32617846, -0.29868397,  0.20193954,  0.30667478,  0.31873024,
        0.2016134 ,  0.43378648,  0.47674039,  0.31715351,  0.24139658,
       -0.26146856, -0.18887506,  0.35301107, -0.27488959,  0.23525426,
        0.19165336, -0.19897534,  0.27977583,  0.30901793,  0.26200381,
        0.35429332,  0.45641774,  0.41149852,  0.20614783,  0.25451243,
        0.30824742, -0.23786043, -0.18960781,  0.20449367, -0.20509453,
        0.25381523,  0.3702769 ,  0.40706384,  0.20391238, -0.27192754,
       -0.25292361, -0.24932826,  0.31200898,  0.35658988, -0.28991827,
        0.32732078,  0.21048419, -0.2555002 ,  0.33446142,  0.31846702,
        0.3756651 ,  0.24019203,  0.19484946,  0.23070559, -0.1912805 ,
       -0.2208318 ,  0.21662125,  0.22002111, -0.20819339,  0.28416109,
        0.3089352 ,  0.25334889,  0.19885857,  0.19937277,  0.2003258 ,
        0.21410704, -0.20324332, -0.24062882,  0.33831805,  0.45128241,
        0.42318794,  0.26979816,  0.24569348,  0.19467181, -0.22439747,
       -0.23610638,  0.33610094, -0.35622585, -0.32678759, -0.28583699,
        0.23611142,  0.19910087,  0.37983894,  0.52548754,  0.49017841,
       -0.29190075,  0.19543776,  0.31310996, -0.22246888, -0.22793868,
        0.25750288,  0.21925233, -0.32464263,  0.26283491, -0.34749225,
        0.28913781,  0.48540911,  0.52422744, -0.34413481,  0.24130091,
       -0.19984326, -0.3238036 ,  0.19879632, -0.28852692,  0.22191215,
        0.42019778,  0.26274392,  0.37243652, -0.39725471,  0.21113659,
       -0.2875244 , -0.19679615, -0.24620742, -0.36483783,  0.28950182,
        0.318589  ,  0.30672634,  0.24961588, -0.26839179, -0.2010386 ,
       -0.25961766, -0.40492609, -0.23223321, -0.55603802, -0.58891398,
       -0.54334605,  0.19050133,  0.49021012,  0.56495219, -0.43854132,
        0.34767506, -0.27845722, -0.28449187, -0.24811029, -0.20508733,
       -0.48655605,  0.29614365,  0.26553199, -0.34555063, -0.51445884,
       -0.56640643, -0.2125162 ,  0.46955219, -0.70376217, -0.49191481,
       -0.69336778, -0.64994049, -0.62535316, -0.36603644,  0.44890344,
       -0.36260042, -0.25611719,  0.32788637,  0.25616613,  0.21799427,
       -0.29648772, -0.38028705, -0.54635656, -0.58415914,  0.20327184,
       -0.28561237, -0.35973993, -0.42157236,  0.47154209, -0.67840326,
       -0.54703152,  0.19202891, -0.67930907, -0.63695621, -0.25882787,
       -0.65857929, -0.36772045, -0.32443061, -0.3199282 ,  0.21027337,
       -0.25411561, -0.28074852,  0.19757298,  0.25449437, -0.33960751,
        0.44112468, -0.23045963, -0.47432756, -0.27420062,  0.38908798,
       -0.49414018, -0.61253566, -0.63132322, -0.44231027, -0.3029843 ,
        0.24111749, -0.18873419,  0.38340241, -0.48824012,  0.25831479,
        0.32312015, -0.57384288, -0.66999745, -0.38858339, -0.21523561,
        0.30930325, -0.19127318,  0.23241602, -0.21577394, -0.20149113,
       -0.26317063, -0.27257231, -0.60351896, -0.40298077, -0.62397236,
       -0.49984393,  0.41582239, -0.51200885, -0.23095383,  0.43038407,
       -0.34751782, -0.46115214, -0.55469573, -0.63884634, -0.47749963,
        0.28564614, -0.20507434, -0.26781842, -0.25500137, -0.22094613,
        0.3775717 , -0.21529332, -0.29863986, -0.27274269, -0.29905617,
        0.30468902,  0.20009278, -0.37474912,  0.26904348, -0.45575744,
        0.19302134,  0.32719749, -0.57403201,  0.25763026, -0.62011772,
       -0.5561325 ,  0.21462852,  0.4100998 , -0.45382112, -0.2276383 ,
       -0.60212833,  0.43271619, -0.49045783,  0.35731325, -0.3196398 ,
        0.24557397,  0.23634641,  0.24463539,  0.29172647,  0.37074596,
       -0.42356062,  0.294361  , -0.30741668, -0.41196263, -0.28354171,
       -0.19613943, -0.46261561, -0.51029575, -0.5288564 ,  0.31830224,
       -0.56130838, -0.5696848 , -0.32505792, -0.20086014, -0.1946705 ,
        0.44008023,  0.24802102, -0.23606107, -0.19272043, -0.36103937,
       -0.26526624, -0.20694995, -0.450892  , -0.19327569, -0.429986  ,
       -0.51074296, -0.3097485 , -0.44938585, -0.5468272 , -0.53175592,
       -0.50057751, -0.23443   , -0.30346483,  0.274468  , -0.39889666,
        0.37081411, -0.26680171,  0.21497257,  0.22829817, -0.23809771,
       -0.32217827, -0.22239928, -0.29429063, -0.29656312,  0.23510972,
       -0.30679667, -0.26617894, -0.22637013,  0.34896412, -0.44782519,
       -0.48848712, -0.37749401,  0.37556747, -0.43270257,  0.26187658,
       -0.27067605, -0.50281447, -0.45982131,  0.31681889, -0.46467596,
        0.35373446,  0.2679944 , -0.33922783, -0.2144931 , -0.18928745,
        0.29576135,  0.48413101,  0.22988029,  0.31330812,  0.37990645,
        0.41987348, -0.26000643, -0.29748419,  0.21051922, -0.43624654,
        0.21805957,  0.21714012, -0.25364137,  0.28260705, -0.31302336,
       -0.34441349,  0.19918184,  0.44153953,  0.28952456,  0.24994519,
       -0.33811021, -0.29344395,  0.23286153, -0.37246266, -0.40404975,
       -0.31739163, -0.19608225, -0.35538325, -0.20140728, -0.19333379,
       -0.24539508, -0.20698659, -0.21731357,  0.20642623,  0.32708964,
        0.24179067,  0.22430632,  0.32484975, -0.29444978, -0.36552095,
        0.19526346, -0.40288195, -0.33553672, -0.38871509, -0.37108067,
        0.28210393,  0.27778256, -0.2008274 ,  0.36130556,  0.29080713,
        0.35019189, -0.25609776,  0.34496027, -0.33227015,  0.19966726,
        0.27930537, -0.30286622, -0.22803766,  0.2466834 ,  0.23043151,
        0.22518194,  0.23066638,  0.21709441,  0.19190988,  0.19926547,
       -0.27211472, -0.27247199,  0.21541202,  0.25011295,  0.23732318,
        0.27580285,  0.26024562, -0.19053677, -0.24174097, -0.20352806,
       -0.19881554, -0.23906694, -0.21176726, -0.22649966, -0.23250964,
       -0.19335814, -0.24597539,  0.21351585, -0.20813833, -0.21454236,
        0.20836315, -0.20172459, -0.20523936,  0.21833704, -0.24622288,
        0.30139905, -0.26752415, -0.26241577, -0.20824529, -0.20378819,
       -0.28337958,  0.2304033 ,  0.21212874,  0.30728438,  0.27091536,
        0.33130345, -0.22393049,  0.22363962,  0.34555703, -0.29098275,
       -0.27585939,  0.29020497, -0.23243585,  0.21601883,  0.19897212,
        0.36731762, -0.29096207,  0.26655877,  0.24637116,  0.25871208,
       -0.34645396, -0.25434053,  0.22297841,  0.37915716,  0.26502022,
        0.21690294, -0.28488797, -0.31035045, -0.27133095,  0.19526312,
        0.36966926,  0.19241545, -0.21725406, -0.22804293,  0.31354529,
        0.25553054, -0.24333474, -0.30474791, -0.1929225 ,  0.19018449,
       -0.3283599 , -0.24875553,  0.30402502,  0.35598519,  0.20605215,
       -0.19527185, -0.19645765, -0.22504854, -0.31924519,  0.20720907,
       -0.3332085 , -0.24148425, -0.29650769, -0.21490988,  0.35449231,
        0.30514207,  0.30217624,  0.23465416,  0.30649105,  0.27471706,
        0.2343221 , -0.30240408, -0.2734195 ,  0.32773963,  0.23771191,
       -0.22960666, -0.23975699,  0.34351018,  0.2560285 ,  0.21364881,
        0.31719887,  0.21099341, -0.22552453, -0.31861255, -0.30359092,
       -0.27499849,  0.25747907, -0.31480604,  0.23515083,  0.22499041,
       -0.2024283 ,  0.30709219,  0.20271207,  0.24131091,  0.28835207,
       -0.29395649, -0.2032249 , -0.20087714,  0.21062551, -0.19830145,
       -0.21269788, -0.24539798, -0.22833961, -0.25362283, -0.20867716,
        0.19692175,  0.1881962 ,  0.21336493,  0.21061938, -0.19259106,
        0.2514711 ,  0.22315593,  0.28360587, -0.2914055 ,  0.31889412,
       -0.29041272, -0.2423431 , -0.24170072, -0.20963098,  0.23132776])

In [25]:
np.linalg.norm(phi[7])


Out[25]:
0.99999994

In [27]:
np.max(np.abs(signal))


Out[27]:
1.50077415488529

In [19]:
filename = 'MPonTIMITs.pickle'
with open(filename, 'rb') as f:
    phi, params, histories = pickle.load(f, encoding='latin1')

In [23]:
smoothed(histories['loss'],10)



In [12]:
sigset.tiled_plot(phi)



In [13]:
params


Out[13]:
{'learn_rate': 0.01, 'max_iter': 1000.0, 'min_spike': 0.1}

In [14]:
plt.plot(histories['L1acts'], 'b.')


Out[14]:
[<matplotlib.lines.Line2D at 0x1df244bb3c8>]

In [ ]: