<jupyter_start><jupyter_text>Load Data<jupyter_code>key = data.get_output_keys()[4]
key
output = data.load_output(key)
qf = torch.Tensor(output["qf"])
gf = torch.Tensor(output["gf"])
q_pids = np.array(output["q_pids"])
g_pids = np.array(output["g_pids"])
q_camids = np.array(output["q_camids"])
g_camids = np.array(output["g_camids"])
distmat = compute_distmat(qf, gf)
q, g = qf.shape[0], gf.shape[0]
q, g
device = 0
cuda = lambda t: torch.as_tensor(t).cuda(0)<jupyter_output><empty_output><jupyter_text>Baseline Results<jupyter_code>result = evaluate(cuda(distmat), cuda(q_pids), cuda(g_pids), cuda(q_camids), cuda(g_camids), device=device)
result<jupyter_output><empty_output><jupyter_text>Re-ranked Results<jupyter_code>all_distmat = compute_inner_distmat(torch.cat((qf, gf)))
re_distmat = rerank_distmat(all_distmat, qf.shape[0])
re_result = evaluate(re_distmat, q_pids, g_pids, q_camids, g_camids)
re_result<jupyter_output><empty_output><jupyter_text>To CUDA<jupyter_code>qf = cuda(qf)
gf = cuda(gf)
q_pids = cuda(q_pids)
g_pids = cuda(g_pids)
q_camids = cuda(q_camids)
g_camids = cuda(g_camids)<jupyter_output><empty_output><jupyter_text>One-Shot Evaluation Using Modules  Rocchio<jupyter_code>dm = rocchio.run(qf, gf, q_pids, g_pids, q_camids, g_camids, t=100, device=0)
rocchio_distmat = dm.cpu().numpy()
del dm<jupyter_output><empty_output><jupyter_text>Neighborhood Expansion (Min)<jupyter_code>dm = ne.run(qf, gf, q_pids, g_pids, q_camids, g_camids, t=100, method="min", device=0)
ne_min_distmat = dm.cpu().numpy()
del dm<jupyter_output><empty_output><jupyter_text>Neighborhood Expansion (Mean)<jupyter_code>dm = ne.run(qf, gf, q_pids, g_pids, q_camids, g_camids, t=100, method="mean", device=0)
ne_mean_distmat = dm.cpu().numpy()
del dm<jupyter_output><empty_output><jupyter_text>Neighborhood Expansion (Max)<jupyter_code>dm = ne.run(qf, gf, q_pids, g_pids, q_camids, g_camids, t=100, method="max", device=0)
ne_max_distmat = dm.cpu().numpy()
del dm<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15419387242591662, 'fraction_numerical': 0.011049723756906077, 'mean_word_length': 9.709677419354838, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '651382', 'license': 'MIT', 'n_tokens_mistral': 925, 'n_tokens_neox': 892, 'n_words': 127, 'path': 'notebooks/Post Rank GPU.ipynb', 'repo_name': 'itsnamgyu/reid-metric', 'size': '1991'}