def __init__(self, **kwargs): Model.__init__(self) Base.__init__(self) self.metadata = Base.metadata for name, val in kwargs.iteritems(): self.__setattr__(name, val)
def __init__(self, batch_size=10, max_len=30, lstm_size=20, vocab_size=10000, embeddings_dim=20, keep_probs=0.9, attention_size=16, use_embedding=True, reg="none", lam=None, sparse=False, kwm_lstm_size=10, learning_rate=0.1): Model.__init__(self, batch_size, max_len, vocab_size, embeddings_dim, use_embedding, learning_rate=learning_rate) self.lstm_size = lstm_size self.attention_size = attention_size self.reg = reg self.lam = lam self.kwm_lstm_size = kwm_lstm_size self.sparse = sparse self.keep_probs = keep_probs self.use_alphas = True self.build_model()
def __init__(self, name=None, autoconnect=None, **kwargs): Model.__init__(self) Base.__init__(self) self.metadata = Base.metadata self.name = name self.autoconnect = autoconnect
def __init__(self, args): Model.__init__(self, args) self.model = None self.build_model() self.train_loss = [] self.valid_loss_history = [] assert (self.seq_length * self.num_characters == self.input)
def __init__(self, train, column, choices=[], beta0=None, name='Enum model', bounds=None): Model.__init__(self, train) self.choices = choices self.column = column self.name = name self._beta0 = list(beta0) self._bounds = list(bounds)
def __init__(self, form): Model.__init__(self, form) self.username = form.get('username', '') self.password = salted_password(form.get('password', '')) self.signature = form.get('signature', '这家伙很懒,什么个性签名都没有留下。') self.user_image = form.get('user_image', '') self.role = form.get('role', 2)
def __init__(self, lower=[0.01, 50, 100], upper = [0.2, 150, 1000], algo_model=dtlz.dtlz1, algo_num_obj=1, algo_num_decs=1): Model.__init__(self) #define upper and lower bounds for dec variables: Mutation rate, no of candidates and no of gens self.name = 'Tuner Model' self.lower_bounds = lower self.upper_bounds = upper self.no_of_decisions = len(lower) self.algo_model = algo_model self.algo_num_obj = algo_num_obj self.algo_num_decs = algo_num_decs
def __init__(self, name=None, password=None, access=None, **kwargs): Model.__init__(self) Base.__init__(self) self.metadata = Base.metadata self.name = name self.password = password self.access = access for name, val in kwargs.iteritems(): self.__setattr__(name, val)
def __init__(self, train): Model.__init__(self, train) self.bymonth = bymonth = train.groupby('month') # First of each month and last of last month dayages = bymonth.first()['dayage'].values self.dayages = numpy.concatenate([dayages, train.iloc[-1:]['dayage'].values]) self.means = bymonth['count'].mean() self.nsegments = len(bymonth) self.nparams = self.nsegments + 1
def __init__(self, model_name): Model.__init__(self, model_name) # initialize the base class # then create/override the variable #self.model_name = "faceDetectionModel" self.model_name = model_name self.logger = logging.getLogger(__name__) try: self.model = IENetwork(self.model_structure, self.model_weights) except Exception: self.logger.exception("The Network could not be initialized. Check that you have the correct model path") self.load_model() Model.check_model(self, model_name)
def __init__(self, degree, memory_depth): # Sanity check memory_depth = Model._check_degree_and_depth(degree, memory_depth) # Initialize fields self.degree = degree self.memory_depth = memory_depth self.kernels = Kernels(degree, memory_depth) self.order_lock = None self._shadow = None self._buffer = None # Call parent's construction methods Model.__init__(self)
def __init__(self, memory_depth, mark='nn', degree=None, **kwargs): # Sanity check if memory_depth < 1: raise ValueError('!! Memory depth should be positive') # Call parent's construction methods Model.__init__(self) # Initialize fields self.memory_depth = memory_depth self.D = memory_depth self.degree = degree # TODO: compromise bamboo = kwargs.get('bamboo', False) bamboo_broad = kwargs.get('bamboo_broad', False) identity_inital = kwargs.get('identity_initial', False) if degree is not None: self.nn = VolterraNet(degree, memory_depth, mark, **kwargs) elif bamboo: self.nn = Bamboo(mark=mark, identity=identity_inital) elif bamboo_broad: self.nn = Bamboo_Broad(mark=mark, inter_type=pedia.fork, identity=identity_inital) else: self.nn = Predictor(mark=mark)
def __init__(self, memory_depth, mark='nn', degree=None, **kwargs): # Sanity check if memory_depth < 1: raise ValueError('!! Memory depth should be positive') # Call parent's construction methods Model.__init__(self) # Initialize fields self.memory_depth = memory_depth self.D = memory_depth self.degree = degree # TODO: compromise bamboo = kwargs.get('bamboo', False) nn_class = kwargs.get('nn_class', None) if nn_class is not None: self.nn = nn_class(mark=mark) elif degree is not None: self.nn = VolterraNet(degree, memory_depth, mark, **kwargs) elif bamboo: self.nn = Bamboo(mark=mark) else: self.nn = Predictor(mark=mark)
def __init__(self, form): Model.__init__(self, form) self.username = form.get('username', '') self.password = salted_password(form.get('password', '')) self.note = form.get('note', '') self.role = form.get('role', 2)
def __init__(self, train): Model.__init__(self, train) dayage = train['dayage'].values self.begin = dayage[0] self.end = dayage[-1] self.mean = train['count'].mean()
def __init__(self, train, name='Unnamed'): self.name = name Model.__init__(self, train)
def __init__(self, app): Model.__init__(self, app)
def __init__(self, dbpath): Model.__init__(self, dbpath, "proxy_users")
def __init__(self, dbpath): Model.__init__(self, dbpath, "downloads") self.Status = Status
def __init__(self, access=None, **kwargs): Model.__init__(self) Base.__init__(self) self.access = access
def __init__(self): Model.__init__(self, self.__class__.__name__.lower())