Esempio n. 1
0
import numpy as np
import scipy.signal as sig
from numpy.lib import stride_tricks
import time
import cPickle as pickle
from scipy import ndimage

import kmeans

from sklearn import cross_validation, ensemble, metrics, svm

import random_search as rs

num_components = 128 # rs.pick_one(64, 128)()
# patch_height = int(np.round(rs.uniform(0.2, 1.0)() * (num_components/2 + 1)))
patch_height = int(np.round(rs.uniform(0.5, 1.0)() * (num_components/2 + 1)))

settings = {
    # prepro + specgram extraction
    'normalise_volume': True,
    'specgram_num_components': num_components,
    'specgram_redundancy': rs.pick_one(2, 4)(), # 1 is no overlap between successive windows, 2 is half overlap, 4 is three quarter overlap
    'log_scale': rs.log_uniform(10**0, 10**1)(), # rs.log_uniform(10**0, 10**2)(), # rs.log_uniform(10**-1, 10**6)(),

    # local specgram normalisation
    'lnorm': True, # rs.pick_one(True, False)(),
    'lnorm_sigma_mean': rs.log_uniform(2, 8)(),
    'lnorm_sigma_std': rs.log_uniform(3, 7)(), # rs.log_uniform(2, 8)(),

    # patch extraction
    'patch_height': patch_height, # number of spectrogram components
Esempio n. 2
0
import numpy as np
import scipy.signal as sig
from numpy.lib import stride_tricks
import time
import cPickle as pickle
from scipy import ndimage

import kmeans

from sklearn import cross_validation, ensemble, metrics, svm

import random_search as rs

num_components = 128  # rs.pick_one(64, 128)()
# patch_height = int(np.round(rs.uniform(0.2, 1.0)() * (num_components/2 + 1)))
patch_height = int(np.round(rs.uniform(0.5, 1.0)() * (num_components / 2 + 1)))

settings = {
    # prepro + specgram extraction
    'normalise_volume': True,
    'specgram_num_components': num_components,
    'specgram_redundancy': rs.pick_one(2, 4)(
    ),  # 1 is no overlap between successive windows, 2 is half overlap, 4 is three quarter overlap
    'log_scale': rs.log_uniform(10**0, 10**1)
    (),  # rs.log_uniform(10**0, 10**2)(), # rs.log_uniform(10**-1, 10**6)(),

    # local specgram normalisation
    'lnorm': True,  # rs.pick_one(True, False)(),
    'lnorm_sigma_mean': rs.log_uniform(2, 8)(),
    'lnorm_sigma_std': rs.log_uniform(3, 7)(),  # rs.log_uniform(2, 8)(),
from matplotlib.mlab import specgram
import numpy as np
import scipy.signal as sig
from numpy.lib import stride_tricks
import time
import cPickle as pickle

import kmeans

from sklearn import cross_validation, ensemble, metrics, svm

import random_search as rs

num_components = rs.pick_one(64, 128)()
patch_height = int(np.round(rs.uniform(0.2, 1.0)() * (num_components/2 + 1)))

settings = {
    # prepro + specgram extraction
    'normalise_volume': True,
    'specgram_num_components': num_components,
    'specgram_redundancy': rs.pick_one(2, 4)(), # 1 is no overlap between successive windows, 2 is half overlap, 4 is three quarter overlap
    'log_scale': rs.log_uniform(10**-1, 10**6)(),

    # patch extraction
    'patch_height': patch_height, # number of spectrogram components
    'patch_width': rs.uniform_int(6, 16)(), # number of timesteps
    'num_patches_for_learning': 100000,

    # whitening
    'retain': 1 - rs.log_uniform(10**-1, 10**-5)(),
Esempio n. 4
0
from matplotlib.mlab import specgram
import numpy as np
import scipy.signal as sig
from numpy.lib import stride_tricks
import time
import pickle as pickle

import kmeans

from sklearn import cross_validation, ensemble, metrics, svm

import random_search as rs

num_components = rs.pick_one(64, 128)()
patch_height = int(np.round(rs.uniform(0.2, 1.0)() * (num_components/2 + 1)))

settings = {
    # prepro + specgram extraction
    'normalise_volume': True,
    'specgram_num_components': num_components,
    'specgram_redundancy': rs.pick_one(2, 4)(), # 1 is no overlap between successive windows, 2 is half overlap, 4 is three quarter overlap
    'log_scale': rs.log_uniform(10**-1, 10**6)(),

    # patch extraction
    'patch_height': patch_height, # number of spectrogram components
    'patch_width': rs.uniform_int(6, 16)(), # number of timesteps
    'num_patches_for_learning': 100000,

    # whitening
    'retain': 1 - rs.log_uniform(10**-1, 10**-5)(),