Example #1
0
  def __init__(self, n_candidates, GRAD_SIZE, EXP_SIZE, k_initial, k_increase, TB_QUEUE_SIZE=None, TB_WINDOW_SIZE=None, prev_qeury_len=None, *args, **kargs):
    super(TD_NSGD_DSP, self).__init__(*args, **kargs)
    self.model = LinearModel(n_features = self.n_features,
                             learning_rate = self.learning_rate,
                             n_candidates = n_candidates)
    self.GRAD_SIZE = GRAD_SIZE
    self.EXP_SIZE = EXP_SIZE
    self.TB_QUEUE_SIZE = TB_QUEUE_SIZE
    self.TB_WINDOW_SIZE = TB_WINDOW_SIZE
    self.sample_basis = True
    self.clicklist = np.empty([self.GRAD_SIZE,1], dtype=int) #click array
    self.grad = np.zeros([self.GRAD_SIZE,self.n_features], dtype=float)
    self.gradCol = 0

    # DQ tie-break related lists
    self.difficult_NDCG =[]
    self.difficult_queries =[]
    self.difficult_document =[]
    self.difficult_time =[]
    self.query_id = 0

    self.k_initial = k_initial
    self.k_increase = k_increase

    # Secondary techniques
    self.prev_qeury_len = prev_qeury_len
    if prev_qeury_len:
      self.prev_feat_list = []
Example #2
0
 def __init__(self, learning_rate, learning_rate_decay, *args, **kargs):
     super(TD_DBGD, self).__init__(*args, **kargs)
     self.learning_rate = learning_rate
     self.model = LinearModel(n_features=self.n_features,
                              learning_rate=learning_rate,
                              n_candidates=1,
                              learning_rate_decay=learning_rate_decay)
     self.multileaving = TeamDraftMultileave(n_results=self.n_results)
Example #3
0
 def __init__(self, learning_rate, learning_rate_decay, *args, **kargs):
     super(PDGD, self).__init__(*args, **kargs)
     self.learning_rate = learning_rate
     self.learning_rate_decay = learning_rate_decay
     self.model = LinearModel(n_features=self.n_features,
                              learning_rate=learning_rate,
                              learning_rate_decay=learning_rate_decay,
                              n_candidates=1)
Example #4
0
    def __init__(self, alpha, _lambda, refine, rank, update, learning_rate, learning_rate_decay, ind, *args, **kargs):
        super(PairRank, self).__init__(*args, **kargs)

        self.alpha = alpha
        self._lambda = _lambda
        self.refine = refine
        self.rank = rank
        self.update = update
        self.learning_rate = learning_rate
        self.learning_rate_decay = learning_rate_decay
        self.ind = ind
        self.A = self._lambda * np.identity(self.n_features)
        self.InvA = np.linalg.pinv(self.A)
        self.model = LinearModel(
            n_features=self.n_features, learning_rate=learning_rate, learning_rate_decay=1, n_candidates=1,
        )
        self.history = {}
        self.n_pairs = []
        self.pair_index = []
        self.log = {}
        self.get_name()
Example #5
0
    def __init__(self,
                 k_initial,
                 k_increase,
                 n_candidates,
                 prev_qeury_len=None,
                 docspace=[False, 0],
                 *args,
                 **kargs):
        super(P_MGD_DSP, self).__init__(*args, **kargs)
        self.n_candidates = n_candidates
        self.model = LinearModel(n_features=self.n_features,
                                 learning_rate=self.learning_rate,
                                 n_candidates=self.n_candidates)

        self.k_initial = k_initial
        self.k_increase = k_increase

        self.prev_qeury_len = prev_qeury_len  # queue size of features from previous queries
        if prev_qeury_len:
            self.prev_feat_list = []
        # for document space length experiment
        # docspace=[True,3] means use superset of document space with three additional documents to perfect DS user examined.
        self.docspace = docspace
Example #6
0
 def __init__(self, n_candidates, *args, **kargs):
   super(TD_MGD, self).__init__(*args, **kargs)
   self.model = LinearModel(n_features = self.n_features,
                            learning_rate = self.learning_rate,
                            n_candidates = n_candidates,
                            learning_rate_decay = self.model.learning_rate_decay)