Example #1
0
    def __init__(self, **kwargs):
        Model.__init__(self)
        Base.__init__(self)
        self.metadata = Base.metadata

        for name, val in kwargs.iteritems():
            self.__setattr__(name, val)
Example #2
0
 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()
Example #3
0
    def __init__(self, name=None, autoconnect=None, **kwargs):
        Model.__init__(self)
        Base.__init__(self)
        self.metadata = Base.metadata

    	self.name = name
        self.autoconnect = autoconnect
Example #4
0
 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)
Example #6
0
 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)
Example #7
0
 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
Example #8
0
 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
Example #9
0
File: user.py Project: daeyun/ppbot
    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
Example #11
0
 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)
Example #12
0
    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)
Example #13
0
  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)
Example #14
0
    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)
Example #15
0
 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)
Example #18
0
 def __init__(self, app):
     Model.__init__(self, app)
Example #19
0
	def __init__(self, dbpath):
		Model.__init__(self, dbpath, "proxy_users")
Example #20
0
	def __init__(self, dbpath):
		Model.__init__(self, dbpath, "downloads")
		self.Status = Status
Example #21
0
File: user.py Project: daeyun/ppbot
 def __init__(self, access=None, **kwargs):
     Model.__init__(self)
     Base.__init__(self)
     self.access = access
Example #22
0
 def __init__(self):
     Model.__init__(self, self.__class__.__name__.lower())