<jupyter_start><jupyter_text>save_bottlebeck_features()<jupyter_code>np.load(train_bottlenecks).shape
np.load(validation_bottlenecks).shape
train_top_model()
model = Sequential()
model.add(Flatten(input_shape=(5,5,2048)))
model.add(Dense(256, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(64, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(15, activation='softmax'))
model.load_weights('/data/nacti/initial_set/bottleneck_fc_model.h5')
preds = np.argmax(model.predict(np.load(validation_bottlenecks)), axis=1)
labels = np.argmax(build_labels_from_directory(validation_data_dir), axis=1)
sum(labels == preds)/len(labels)
print(confusion_matrix(labels, preds))
plt.imshow(confusion_matrix(labels, preds))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16073781291172595, 'fraction_numerical': 0.026350461133069828, 'mean_word_length': 12.818181818181818, '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': '52656', 'license': 'MIT', 'n_tokens_mistral': 302, 'n_tokens_neox': 296, 'n_words': 27, 'path': 'training/notebooks/NACTIBottleneckTrain.ipynb', 'repo_name': 'mmstevenson/CritterCounter', 'size': '759'}