Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self,config):
ModelBase.__init__(self)
self.config = config
self.verbose = self.config['verbose']
self.build_model()
def __init__(self, dataset, classfeatureindex = -1, alpha = 0.2, maxiter = 50, *args, **kwargs):
ModelBase.__init__(self, dataset, 'LOGISTIC', *args, **kwargs)
self.classfeatureindex = classfeatureindex #index of the column which defines the feature in dataset
self.Test = self.Classify2
self.Apply = self.ClassifyDataset
self.Train = self.Regress
self.Save = self.DumpLogistic
self.Load = self.LoadLogistic
self.Graph = self.ShowImage
self.Positive = 1
self.Negative = -1
# use default
# self.T = self.RealValue
self.tree = {}
self.sigmoid = lambda input_n:np.vectorize(lambda n: 1.0/(1.0+math.e**(-n)))(input_n)
self.alpha = alpha
self.maxiter = maxiter
def __init__(self, config):
ModelBase.__init__(self)
self.config = config
self.verbose = self.config['verbose']
self.name = 'alexnet'
batch_size = config['batch_size']
flag_datalayer = config['use_data_layer']
lib_conv = config['lib_conv']
n_softmax_out=config['n_softmax_out']
# ##################### BUILD NETWORK ##########################
# allocate symbolic variables for the data
# 'rand' is a random array used for random cropping/mirroring of data
x = T.ftensor4('x')
y = T.lvector('y')
rand = T.fvector('rand')
lr = T.scalar('lr')
def __init__(self,config):
ModelBase.__init__(self)
self.config = config
self.verbose = config['verbose']
self.name = 'vggnet'
# input shape in c01b
self.channels = 3 # 'c' mean(R,G,B) = (103.939, 116.779, 123.68)
self.input_width = self.config['input_width'] # '0' single scale training 224
self.input_height = self.config['input_height'] # '1' single scale training 224
self.batch_size = self.config['batch_size'] # 'b'
# output dimension
self.n_softmax_out = self.config['n_softmax_out']
def __init__(self,config):
ModelBase.__init__(self)
self.config = config
self.verbose = self.config['verbose']
self.build_model()
# count params
if self.verbose: self.count_params()
def __init__(self,config):
ModelBase.__init__(self)
self.config = config
self.verbose = self.config['verbose']
self.name = 'cnncifar10'
# input shape in c01b
from data.cifar10 import Cifar10_data
data = Cifar10_data(config)
self.channels = data.channels # 'c' mean(R,G,B) = (103.939, 116.779, 123.68)
self.input_width = data.input_width # '0' single scale training 224
self.input_height = data.input_height # '1' single scale training 224
self.batch_size = data.batch_size # 'b'
def __init__(self,config):
ModelBase.__init__(self)
self.verbose = config['verbose']
self.config = config
if self.verbose: print 'GoogLeNet 7/5'
batch_size = config['batch_size']
input_width = config['input_width']
input_height = config['input_height']
n_softmax_out=config['n_softmax_out']
self.name = 'googlenet'
self.batch_size = batch_size
self.input_width = input_width
self.input_height = input_height
self.n_softmax_out = n_softmax_out