environment.py
def generate_context(self):
        """Generates context vector of indicators and computes current
        real reward probability
        """
        context = []
        context_vector = bernuolli(self.context_options)
        if self.add_bias:
            context_vector = np.append([1], context_vector)
        for i in range(self.k_arms):
            context.append(context_vector)
        # pull all arms to generate current mean, rewards and get the optimal one
        # agent/policy/algorithm knows only the context but means are not revealed
        self.current_rewards = [arm.pull(context_vector) for arm, context_vector in zip(self.arms, context)]
        self.current_means = [arm.get_current_mean() for arm in self.arms]
        self.current_optimal_arm = random_argmax(self.current_means)
        self.current_optimal_mean = self.current_means[self.current_optimal_arm]

        return context
Generates context vector of indicators and computes current
        real reward probability
        
Generates context vector of indicators and computes current
real reward probability
Generates context vector of indicators and computes current real reward probability
def generate_context(self):
        context = []
        context_vector = bernuolli(self.context_options)
        if self.add_bias:
            context_vector = np.append([1], context_vector)
        for i in range(self.k_arms):
            context.append(context_vector)
        self.current_rewards = [arm.pull(context_vector) for arm, context_vector in zip(self.arms, context)]
        self.current_means = [arm.get_current_mean() for arm in self.arms]
        self.current_optimal_arm = random_argmax(self.current_means)
        self.current_optimal_mean = self.current_means[self.current_optimal_arm]
        return context
def generate_context ( self ) : context = [ ] context_vector = bernuolli ( self . context_options ) if self . add_bias : context_vector = np . append ( [ 1 ] , context_vector ) for i in range ( self . k_arms ) : context . append ( context_vector ) self . current_rewards = [ arm . pull ( context_vector ) for arm , context_vector in zip ( self . arms , context ) ] self . current_means = [ arm . get_current_mean ( ) for arm in self . arms ] self . current_optimal_arm = random_argmax ( self . current_means ) self . current_optimal_mean = self . current_means [ self . current_optimal_arm ] return context
Generates context vector of indicators and computes current
real reward probability
Generates context vector of indicators and computes current real reward probability
"""Generates context vector of indicators and computes current
        real reward probability
        """ # pull all arms to generate current mean, rewards and get the optimal one # agent/policy/algorithm knows only the context but means are not revealed
self