def plot_f(self, F_samples):
    f_array = np.asarray(F_samples).reshape(((- 1), self.B, self.K), order='F')
    S = f_array.shape[0]
    self.Z_samples = self.Z_samples[(- S):]
    Z_samples_array = np.asarray(self.Z_samples)
    mixture_allocation = np.zeros((S, self.N, self.K))
    mixture_allocation[(np.repeat(range(S), self.N), np.tile(range(self.N), S), Z_samples_array.flatten(order='C'))] = 1
    average_alloc = np.mean(mixture_allocation, axis=0)
    for k in range(self.K):
        plt.figure()
        self.context.plot_realisations(average_alloc[:, k], 111)
        plt.show()
    idx1 = np.random.choice(self.B)
    plot_traceplots(f_array[:, idx1, :], [f'IDX: {idx1}: K={k}' for k in range(self.K)])
    plt.show()
    latent_weight_samples = softmax(np.mean(f_array, axis=0), axis=1)
    latent_weight_samples_full = gp_inflate_duplicate(latent_weight_samples, self.block_assignment_numeric, self.N, self.K)
    plt.figure()
    for k in range(self.K):
        self.context.plot_realisations(latent_weight_samples_full[:, k], 111)
        plt.show()
def plot_f(self, F_samples):
    f_array = np.asarray(F_samples).reshape(((- 1), self.B, self.K), order='F')
    S = f_array.shape[0]
    self.Z_samples = self.Z_samples[(- S):]
    Z_samples_array = np.asarray(self.Z_samples)
    mixture_allocation = np.zeros((S, self.N, self.K))
    mixture_allocation[(np.repeat(range(S), self.N), np.tile(range(self.N), S), Z_samples_array.flatten(order='C'))] = 1
    average_alloc = np.mean(mixture_allocation, axis=0)
    for k in range(self.K):
        plt.figure()
        self.context.plot_realisations(average_alloc[:, k], 111)
        plt.show()
    idx1 = np.random.choice(self.B)
    plot_traceplots(f_array[:, idx1, :], [f'IDX: {idx1}: K={k}' for k in range(self.K)])
    plt.show()
    latent_weight_samples = softmax(np.mean(f_array, axis=0), axis=1)
    latent_weight_samples_full = gp_inflate_duplicate(latent_weight_samples, self.block_assignment_numeric, self.N, self.K)
    plt.figure()
    for k in range(self.K):
        self.context.plot_realisations(latent_weight_samples_full[:, k], 111)
        plt.show()