# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# %reset

# +
import numpy as np
from parameters import *
import matplotlib.pyplot as plt
from sklearn import svm
import time
import pickle
import analysis_spatialcat
import importlib
importlib.reload(analysis_spatialcat)

results = pickle.load(open('spatial_cat_1_newmodelparams.pkl','rb'))

# -

analysis_spatialcat.analyze_model_from_file(results)


model_results = pickle.load(open('model_results_WTLoss.pkl','rb'))
model_results

np.shape(model_results['lesion_accuracy_rnn_start'])
plt.imshow(model_results['lesion_accuracy_out'],aspect='auto')
plt.colorbar()
plt.savefig('w_in.png',bbox_inches='tight')
plt.xlabel('Hidden neurons')
plt.ylabel('Hidden neurons')
plt.title('Trained on spatial cat')
plt.show()

np.shape(model_results['lesion_accuracy_rnn_start'])
plt.imshow(model_results['lesion_accuracy_rnn_start'],aspect='auto')
plt.colorbar()
plt.savefig('w_in.png',bbox_inches='tight')
plt.xlabel('Hidden neurons')
plt.ylabel('Hidden neurons')
plt.title('Trained on spatial cat')
plt.show()
np.where(model_results['lesion_accuracy_rnn_start']<0.9)

StarcoderdataJupyterScriptsDedupFiltered