<jupyter_start><jupyter_text>data[network_name] = [blob1, blob2, ...]<jupyter_code>def make_data(models, cat):
    data = {}
    
    for model in models:
        data[model["name"]] = []
        for blob in model["blobs"]:
            stats = summarize(loadviz(model["directory"], blob), threshold, top_only=True)
            data[model["name"]].append(stats[cat])
    return data
def plot_graph(models, cat):
    data = make_data(models, cat)
    fig = plt.figure(figsize=(12, 8))
    ax = plt.gca()
    for model in models:
        ax.plot(data[model["name"]], label=model["name"])
    ax.set_xticks(range(len(models[0]["blobs"])))
    ax.set_xticklabels(models[0]["blobs"])
    ax.set_title("Comparison_of_number_of_detectors_{}".format(cat))

    plt.legend(loc="upper left")

    ax.set_ylabel('portion of units alinged to a category concept')
    return fig, ax
def compare_high_low(low_model, high_model):
    
    fig, axes = plt.subplots(2, 3, figsize=(12, 8))
    axes = axes.reshape(-1)
    categories = category_colors.keys()[:-1]
    
    for i, cat in enumerate(categories):
        data = make_data([low_model, high_model], cat)
        
        low_line, = axes[i].plot(data[low_model["name"]])
        highe_line, = axes[i].plot([5, 6, 7], data[high_model["name"]])
        
        fig.legend((low_line, highe_line), (low_model["name"], high_model["name"]), loc="upper right")
        fig.tight_layout()
        fig.subplots_adjust(top=0.87, bottom=0.1)
        
        axes[i].set_title(cat)
        axes[i].set_xticklabels(low_model["blobs"])
    return fig, axes
fig, axes = compare_high_low(alex, alex_hi)
axes[4].text(0,-0.1, script )
fig.suptitle("Comparison of number of detectors alexnet", fontsize=15)


fig.savefig(os.path.join("figures/number_of_detectors/", "comparison_num_of_detectors_alexnet.pdf"))
plt.show()
fig, axes = compare_high_low(sentibank, senti_hi)
axes[4].text(0,-0.1, script )
fig.suptitle("Comparison of number of detectors sentibank", fontsize=15)


fig.savefig(os.path.join("figures/number_of_detectors/", "comparison_num_of_detectors_sentibank.pdf"))
plt.show()
fig, axes = compare_high_low(vgg_material, vgg_mat_hi)
axes[4].text(0,-0.1, script )
fig.suptitle("Comparison of number of detectors vgg_material", fontsize=15)

fig.savefig(os.path.join("figures/number_of_detectors/", "comparison_num_of_detectors_vgg_material.pdf"))
plt.show()
fig, axes = compare_high_low(vgg_face, vgg_face_hi)
axes[4].text(0,-0.1, script )
fig.suptitle("Comparison of number of detectors vgg_face", fontsize=15)

fig.savefig(os.path.join("figures/number_of_detectors/", "comparison_num_of_detectors_vgg_face.pdf"))
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15613382899628253, 'fraction_numerical': 0.017100371747211896, 'mean_word_length': 4.469512195121951, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '423752', 'license': 'MIT', 'n_tokens_mistral': 1031, 'n_tokens_neox': 975, 'n_words': 164, 'path': 'research/comparison_high_resolution_numdetec_1215.ipynb', 'repo_name': 'bonyuta0204/NetDissec', 'size': '2690'}