def run_sampling(self, number_of_iterations):
    iteration = 0
    while (iteration < number_of_iterations):
        num_current_samples = min(len(self.beta_sampler.samples), len(self.f_sampler.samples))
        self.beta_sampler.samples = self.beta_sampler.samples[(- num_current_samples):]
        self.f_sampler.samples = self.f_sampler.samples[(- num_current_samples):]
        self.Z_samples = self.Z_samples[(- num_current_samples):]
        if (((iteration + 1) % self.hmc_info_interval) == 0):
            self.__save_output(iteration)
        self.beta_sampler.sample_one()
        self.current_beta = self.beta_sampler.estimand
        new_Z = self.sample_Z()
        self.Z_samples.append(np.where((new_Z > 0))[1])
        self.current_Z = new_Z
        self.f_sampler.sample_one()
        self.current_f = self.f_sampler.estimand
        iteration += 1
    self.logger.info('Sampling completed - saving model.')
    self.__save_output(iteration)
def run_sampling(self, number_of_iterations):
    iteration = 0
    while (iteration < number_of_iterations):
        num_current_samples = min(len(self.beta_sampler.samples), len(self.f_sampler.samples))
        self.beta_sampler.samples = self.beta_sampler.samples[(- num_current_samples):]
        self.f_sampler.samples = self.f_sampler.samples[(- num_current_samples):]
        self.Z_samples = self.Z_samples[(- num_current_samples):]
        if (((iteration + 1) % self.hmc_info_interval) == 0):
            self.__save_output(iteration)
        self.beta_sampler.sample_one()
        self.current_beta = self.beta_sampler.estimand
        new_Z = self.sample_Z()
        self.Z_samples.append(np.where((new_Z > 0))[1])
        self.current_Z = new_Z
        self.f_sampler.sample_one()
        self.current_f = self.f_sampler.estimand
        iteration += 1
    self.logger.info('Sampling completed - saving model.')
    self.__save_output(iteration)