<commit_before>import sys
import argparse
import numpy as np
import theano
import lasagne
import functools

#higher recrusion limit for large models
sys.setrecursionlimit(10000)

from lasagne import layers
from lasagne import init

from sklearn import svm

from lasagne.updates import *
from nolearn.lasagne import NeuralNet

#these would be faster for 
#try:
#from lasagne.layers.cuda_convnet import Conv2DCCLayer as Conv2DLayer
#from lasagne.layers.cuda_convnet import MaxPool2DCCLayer as MaxPool2DLayer
#except ImportError:

Conv2DLayer = layers.Conv2DLayer
MaxPool2DLayer = layers.MaxPool2DLayer

from lasagne.nonlinearities import rectify,softmax

from sklearn.cross_validation import train_test_split
from sklearn.cross_validation import StratifiedShuffleSplit
from sklearn.metrics import classification_report,recall_score,accuracy_score,confusion_matrix,roc_curve,roc_auc_score

from sklearn.preprocessing import StandardScaler
from sklearn.lda import LDA
from sparse_filtering.sparse_filtering import SparseFiltering

from sklearn.decomposition import RandomizedPCA
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.ensemble import RandomForestClassifier

import sklearn
import itertools

from sklearn import linear_model

#plotting
from pylab import *
import matplotlib.pyplot

from utils import unspeech_utils,ZCA,mean_substract
from feature_gen import energy,windowed_fbank

import scipy.stats
from scipy.stats import itemfreq

#pickle currently buggy with nolearn, using dill as replacement
#import cPickle as pickle
import dill as pickle

def float32(k):
    return np.cast['float32'](k)

class EarlyStopping(object):
    def __init__(self, patience=100):
        self.patience = patience
        self.best_valid = np.inf
        self.best_valid_epoch = 0
        self.best_weights = None

    def __call__(self, nn, train_history):
        current_valid = train_history[-1]['valid_loss']
        current_epoch = train_history[-1]['epoch']
        if current_valid < self.best_valid:
            self.best_valid = current_valid
            self.best_valid_epoch = current_epoch<commit_msg>removed ZCA<commit_after>import sys
import argparse
import numpy as np
import theano
import lasagne
import functools

#higher recrusion limit for large models
sys.setrecursionlimit(10000)

from lasagne import layers
from lasagne import init

from sklearn import svm

from lasagne.updates import *
from nolearn.lasagne import NeuralNet

#these would be faster for 
#try:
#from lasagne.layers.cuda_convnet import Conv2DCCLayer as Conv2DLayer
#from lasagne.layers.cuda_convnet import MaxPool2DCCLayer as MaxPool2DLayer
#except ImportError:

Conv2DLayer = layers.Conv2DLayer
MaxPool2DLayer = layers.MaxPool2DLayer

from lasagne.nonlinearities import rectify,softmax

from sklearn.cross_validation import train_test_split
from sklearn.cross_validation import StratifiedShuffleSplit
from sklearn.metrics import classification_report,recall_score,accuracy_score,confusion_matrix,roc_curve,roc_auc_score

from sklearn.preprocessing import StandardScaler
from sklearn.lda import LDA
from sparse_filtering.sparse_filtering import SparseFiltering

from sklearn.decomposition import RandomizedPCA
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.ensemble import RandomForestClassifier

import sklearn
import itertools

from sklearn import linear_model

#plotting
from pylab import *
import matplotlib.pyplot

from utils import unspeech_utils,mean_substract
from feature_gen import energy,windowed_fbank

import scipy.stats
from scipy.stats import itemfreq

#pickle currently buggy with nolearn, using dill as replacement
#import cPickle as pickle
import dill as pickle

def float32(k):
    return np.cast['float32'](k)

class EarlyStopping(object):
    def __init__(self, patience=100):
        self.patience = patience
        self.best_valid = np.inf
        self.best_valid_epoch = 0
        self.best_weights = None

    def __call__(self, nn, train_history):
        current_valid = train_history[-1]['valid_loss']
        current_epoch = train_history[-1]['epoch']
        if current_valid < self.best_valid:
            self.best_valid = current_valid
            self.best_valid_epoch = current_epoch
{'fraction_non_alphanumeric': 0.050402271651680076, 'fraction_numerical': 0.010884997633696167, 'mean_word_length': 5.234513274336283, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3573695', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1274, 'n_words': 362}