# generate some data T, M_r, M_c, data_inverse_permutation_indices = du.gen_factorial_data_objects( get_next_seed(), num_clusters, num_cols, num_rows, num_views, max_mean=100, max_std=1, send_data_inverse_permutation_indices=True) view_assignment_truth, X_D_truth = ctu.truth_from_permute_indices( data_inverse_permutation_indices, num_rows, num_cols, num_views, num_clusters) # run some tests engine = LocalEngine() multi_state_ARIs = [] multi_state_mean_test_lls = [] X_L_list, X_D_list = engine.initialize(M_c, M_r, T, get_next_seed(), n_chains=n_chains) multi_state_ARIs.append( ctu.get_column_ARIs(X_L_list, view_assignment_truth)) for time_i in range(n_times): X_L_list, X_D_list = engine.analyze( M_c, T, X_L_list, X_D_list, get_next_seed(), n_steps=n_steps, CT_KERNEL=CT_KERNEL) multi_state_ARIs.append( ctu.get_column_ARIs(X_L_list, view_assignment_truth)) # multi_state_mean_test_lls.append( # ctu.calc_mean_test_log_likelihoods(M_c, T, # X_L_list, X_D_list, T_test)) X_L_list, X_D_list, diagnostics_dict = engine.analyze( M_c, T, X_L_list, X_D_list, get_next_seed(), n_steps=n_steps, do_diagnostics=True)
X_L, X_D = engine.initialize(M_c, M_r, T, n_chains=1) single_state_ARIs.append(ctu.get_column_ARI(X_L, view_assignment_truth)) single_state_mean_test_lls.append( ctu.calc_mean_test_log_likelihood(M_c, T, X_L, X_D, T_test) ) for time_i in range(n_times): X_L, X_D = engine.analyze(M_c, T, X_L, X_D, n_steps=n_steps) single_state_ARIs.append(ctu.get_column_ARI(X_L, view_assignment_truth)) single_state_mean_test_lls.append( ctu.calc_mean_test_log_likelihood(M_c, T, X_L, X_D, T_test) ) # multistate test multi_state_ARIs = [] multi_state_mean_test_lls = [] X_L_list, X_D_list = engine.initialize(M_c, M_r, T, n_chains=n_chains) multi_state_ARIs.append(ctu.get_column_ARIs(X_L_list, view_assignment_truth)) multi_state_mean_test_lls.append(ctu.calc_mean_test_log_likelihoods(M_c, T, X_L_list, X_D_list, T_test)) for time_i in range(n_times): X_L_list, X_D_list = engine.analyze(M_c, T, X_L_list, X_D_list, n_steps=n_steps) multi_state_ARIs.append(ctu.get_column_ARIs(X_L_list, view_assignment_truth)) multi_state_mean_test_lls.append(ctu.calc_mean_test_log_likelihoods(M_c, T, X_L_list, X_D_list, T_test)) # print results print('generative_mean_test_log_likelihood') print(generative_mean_test_log_likelihood) # print('single_state_mean_test_lls:') print(single_state_mean_test_lls) #