<jupyter_start><jupyter_text>Multi-class MRF complete graph data generation<jupyter_code>coupling_data = np.zeros((n, n, len(cw_range), num_samples))
bias_data = np.zeros((n, num_classes, len(cw_range), num_samples))
logZ_data = np.zeros((len(cw_range), num_samples))
modes_data = np.zeros((len(cw_range), num_samples))
all_strings = generate_strings(n, num_classes)
for i, cw in enumerate(cw_range):
    for sample in range(num_samples):
        print(i, sample)
        A = np.random.uniform(low=-cw, high=cw, size=(n, n))
        for j in range(n):
            A[j, j] = 0
        A = (A + A.T) / 2
        h = np.random.uniform(low=-1, high=1, size=(n, num_classes))
        logZ, mode = ground_truth(A, h, all_strings)
        coupling_data[:, :, i, sample] = A
        bias_data[:, :, i, sample] = h
        logZ_data[i, sample] = logZ
        modes_data[i, sample] = mode<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup