Пример #1
0
    def __init__(self,
                 featureDimension,
                 alpha,
                 lambda_,
                 createTime,
                 NoiseScale,
                 delta_1,
                 delta_2,
                 init="zero"):
        LinUCBUserStruct.__init__(self,
                                  featureDimension=featureDimension,
                                  alpha=alpha,
                                  lambda_=lambda_,
                                  NoiseScale=NoiseScale,
                                  init=init)
        self.alpha = alpha
        self.fail = 0.0
        self.success = 0.0
        self.failList = []
        self.plays = 0.0
        self.updates = 0.0
        self.emp_loss = 1.0
        self.createTime = createTime
        self.time = createTime
        self.lambda_ = lambda_
        self.NoiseScale = NoiseScale
        self.sigma = 1.e-2  #Used in the high probability bound, i.e, with probability at least (1 - sigma) the confidence bound. So sigma should be very small
        self.model_id = createTime
        self.ratio = 0.0

        self.badness = 0.0
        self.badness_CB = 0.5
        self.active = True
        self.update_num = 0.0

        self.delta_1 = delta_1
        self.delta_2 = delta_2
        self.history = []
        self.clicks = []
Пример #2
0
    def __init__(self,
                 featureDimension,
                 lambda_,
                 RankoneInverse=False,
                 nIn=25,
                 nOut=25):
        LinUCBUserStruct.__init__(self,
                                  featureDimension=featureDimension,
                                  lambda_=lambda_,
                                  RankoneInverse=RankoneInverse)

        self.reward = 0

        self.W = theano.shared(value=numpy.identity(
            nIn, dtype=theano.config.floatX),
                               name='W',
                               borrow=True)

        self.Bias = theano.shared(value=numpy.zeros(
            (nOut, ), dtype=theano.config.floatX),
                                  name='Bias',
                                  borrow=True)

        # 计算加入权重矩阵之后的评分预估值
        self.estimateReward = []

        # 取出预估评分值中的最高值,作为预测item分值
        self.recommendReward = 0

        # parameters of the model
        self.params = [self.W, self.Bias]

        # keep track of model input
        # self.inputMean = inputMean
        # self.inputBias = inputBias

        # learningRate 我随机取的一个数字,应该还需要随后继续做调整
        self.learningRate = 0.13
 def __init__(self, featureDimension, lambda_):
     LinUCBUserStruct.__init__(self,
                               featureDimension=featureDimension,
                               lambda_=lambda_)
     self.learn_stats = articleAccess()
Пример #4
0
 def __init__(self, featureDimension, lambda_):
     LinUCBUserStruct.__init__(self, featureDimension= featureDimension, lambda_ = lambda_)
     self.reward = 0
Пример #5
0
	def __init__(self, featureDimension, lambda_):
		LinUCBUserStruct.__init__(self, featureDimension= featureDimension, lambda_ = lambda_)
		self.learn_stats = articleAccess()
Пример #6
0
 def __init__(self, featureDimension, lambda_, RankoneInverse=False):
     LinUCBUserStruct.__init__(self, featureDimension=featureDimension, lambda_=lambda_,
                               RankoneInverse=RankoneInverse)
     self.reward = 0
Пример #7
0
 def __init__(self, featureDimension, lambda_, RankoneInverse = False):
     LinUCBUserStruct.__init__(self, featureDimension= featureDimension, lambda_ = lambda_, RankoneInverse = RankoneInverse)
     self.reward = 0
Пример #8
0
	def __init__(self, featureDimension, lambda_, RankoneInverse = False):
		LinUCBUserStruct.__init__(self, featureDimension= featureDimension, lambda_ = lambda_, RankoneInverse = RankoneInverse)
		self.learn_stats = articleAccess()