Topology in neuroscience
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1003 lines
226 KiB

{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Decoding population activity"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"**Imports**"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"from sym_model import Population\n",
"\n",
"import sys\n",
"import seaborn as sns\n",
"import umap\n",
"import numpy as np\n",
"import pandas as pd\n",
"from matplotlib import pyplot as plt\n",
"sys.path.insert(0, './model')\n",
"\n",
"from model import decoding\n",
"from model import persistence\n",
"from utils import get_orientation_phase_grid"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## Getting the data\n",
"\n",
"**Sampling the activity using the model**"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"limit = 1500\n",
"# n_theta, n_phi = 18, 24\n",
"n_theta, n_phi = 9, 12\n",
"step_phi, step_theta = 360 // n_phi, 180 // n_theta"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[0. 0.] [160. 330.]\n"
]
}
],
"source": [
"grid = get_orientation_phase_grid(step_phi, step_theta)\n",
"grid = grid.reshape((-1, 2)) * 180 / np.pi\n",
"print(grid[0], grid[-1])"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"res = Population.random(10).sample_responses(limit, custom_grid=grid, use_sigmoid=False)\n",
"res, phi_deg, theta_deg = res[:, :, 0], res[:, 0, 1], res[:, 0, 2]"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"import pickle\n",
"with open('res.pkl', 'wb') as f:\n",
" pickle.dump(res, f)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"phi_reorder = sorted(list(range(len(phi_deg[:limit]))), key=lambda x: phi_deg[x])\n",
"theta_reorder = sorted(list(range(len(theta_deg[:limit]))), key=lambda x: theta_deg[x])"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAE8AAAAVCAYAAAAHIbMXAAAACXBIWXMAAA7EAAAOxAGVKw4bAAADkElEQVRYCe2Y33EaMRDGsScFkKQD0oEdVxDTAaaD2B3Ekyd4yzgd2K7AY3cQp4JM6AA6MKED8v2EVlmLO+DMQe7BO6PTavVnV59WK51a8/m85dNgMOj48iu/wKcIl8OWo+Fw+EXFIyd6Zf8h0In4JMkBngWpoqfsRPllEGQfyQH1XulY/CyrDkXJr6L8SfkHpSvJJlEWMpXbYr46GeV7yR+drFZWY9dlO84103g3GBjAixP6qfzYWx3lt5JNlT4qYcRbyZfAk+y36r4pf1DeUg4oyLriE4Dir5UuaGOkMotypzz0Nfk2ucZCf622Y4/GZU6flM9s2+Ix11R6ooHSmRKTvfN1nlf9ucpt5Wny4gGYcho3tkN5Tp8l8N6Y11cuo1+pNtudAcwn7DADry9FwRVdoyrsmRqPCjr8kuxUY+MFEFu5G7jmfDa1PVgccQKv9qE+xLq0rV44p1P1Y2vnZONSDwFmTzp/oDxIFp9Cz3f1u2Q3td3bwLz6b/TBE14crDMQvALPv6Ogtg8ksSzYH/EcTngjYKYtr/JeSDr9ApbpDLZnleDVZdtyEIyzyipFG5wYV0bJSBnMNrEQgcex8kVbvmysOuWVbHeKwasDeEysaMu5tluz720EgYfXATQexwp2lMZRLrZxlGx3loFXAA/0V3mN61PIrgLeVvaJngKIU5mry6XSRImQgSdCtyonD12Idv7d2PbMEmJeG8/bijRhA75o4iazg4Nt+uwSrv7EOryQtnawiN09VbTdGxQcDvBA3ybpG1ThbfvlfczzHqNXcRec5Y0kA1xAtPZ5k12W19peoBy8poCH4cSdbYg/BA6enPhjGQFYBI28TBcGMZFAarftgtpQ6/K1thcMwCJPAG+kdFLQIBdZ4FzyDk2U03OqnMMgUJx8XwX+HoyIb/zHPgNGZWIh15WwvWM9V5mivxEbq0peh+1eX3CKAz21HEnKhIg7SyQ5KwMRj5g0YDNJJmtXjpZ46ohpMyUOCBaEf13aJ1IZffyKES6Mlh4G1M6uT6UPEda5LNcYtdpueqJtF+EtTwCOAbFpb3eyqafUbpJdsqejNMYmti2Exzx76QjS///hiQxPbhJxWwCvBXgykO3HY19ZMKftXkm2EAbC/XCvilcoi/iAUwhX5nl0IZin56MVY+yr6lxGft+Xsg31gE/aoeklmc4RWV49mmb0hnPbXTNhwisyDxvhRoCmv281NLTJAa6TAAAAAElFTkSuQmCC",
"text/latex": [
"$\\displaystyle \\left( 108, \\ 10\\right)$"
],
"text/plain": [
"(108, 10)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"res.shape"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"res_reshaped = res.reshape((n_phi, n_theta, -1))"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/lib/python3.10/site-packages/seaborn/distributions.py:2619: FutureWarning: `distplot` is a deprecated function and will be removed in a future version. Please adapt your code to use either `displot` (a figure-level function with similar flexibility) or `histplot` (an axes-level function for histograms).\n",
" warnings.warn(msg, FutureWarning)\n"
]
},
{
"data": {
"text/plain": [
"<AxesSubplot:ylabel='Density'>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB+UHOxAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAikUlEQVR4nO3dd3Rcd5338fdXzXKRi6xiRbYst8gprpHt9EISUhcnWVIJOJBgwsI+C7tkcYBnCQssWeqyZ/fJiYGASUivJgXimISEVMuJe4njXmRJLrJsq0vf548ZB8VI1siaOyPpfl7n6NyZe+fO/f50pfnM71Zzd0REJHxSkl2AiIgkhwJARCSkFAAiIiGlABARCSkFgIhISCkARERCKtAAMLOvmtlqM1tlZg+ZWaaZZZvZIjPbEB0OC7IGERFpX2ABYGaFwP8BSt39VCAVuAGYByx29wnA4uhzERFJsKA3AaUB/c0sDRgA7AJmAwui0xcAVwVcg4iItCMtqDd2951m9mNgG1AHvOjuL5pZvruXR19TbmZ5nb1XTk6OFxcXB1WqiEiftHTp0j3untvR9MACILptfzYwBqgGHjOzm7sw/1xgLkBRURFlZWVBlCki0meZ2dZjTQ9yE9BFwGZ3r3L3JuBJ4EygwswKosUVAJXtzezu89291N1Lc3M7DDARETlOQQbANuB0MxtgZgZcCKwFFgJzoq+ZAzwTYA0iItKBIPcBvG1mjwPvAs3Ae8B8YBDwqJndSiQkrg2qBhER6VhgAQDg7t8Gvn3U6AYivQEREUkinQksIhJSCgARkZBSAIiIhJQCQEQkpBQAIiIhFehRQCJ9zYNvb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
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.distplot((res).ravel().clip(-0.1, 0.1))"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## Plotting joint tunings"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"phase_linspace = np.linspace(0, 360, n_phi)\n",
"orientation_linspace = np.linspace(0, 180, n_theta)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEVCAYAAADuAi4fAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAACD3ElEQVR4nO2dd3gc1fW/37tF0qr33uUq916wwcYUQ2imhBbSQ0ggIcnvm4T0CumNQEIIIQQILfRiwLg33HuRXNR773V37++P2VntrrbZsqSVPO/z6NFq9s7O2dXsmTOfe865QkqJhoaGhsb4RTfaBmhoaGhoDC+ao9fQ0NAY52iOXkNDQ2Ocozl6DQ0NjXGO5ug1NDQ0xjmao9fQ0NAY52iOXsMvhBAdQojc0bbDE0KIJ4QQPxptO0YDIUS2EEIKIQyjbYtGYKI5+oscIcRmIcQXfY2TUoZLKYv8fE0phJjg4bnv2y4aHUKIHiGExeHv4+dqv4N990kpf3G++w8HQoifCiH6Hd7fSSHELef5WiuEEFbb67QLIQqFEJ+70DZrjE80R68xokgpH7FdNMKB+4CP1b+llNNG275h4GWH9/sN4HkhRNJ5vlaV7XUige8C/xRC5F8gOzXGMZqj17AjhPiSEOKMEKJJCPG2ECLV4Tl7lC6EeEYI8bgQ4j1bdLlbCJFne26rbZfDtujz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4APpJSdUsoGYCswy92L+Rv5qESEGHnsrrk0dfXxiUe309rdz2N3zSE0yHMNWFq0iX9/bgHzs2L452fmk58a6fUY18xI4aHVU9hQUMf20w187pJsNv3fCp77wiKumpZMWrSJV768mKV5cXzn1SP
"text/plain": [
"<Figure size 432x288 with 6 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(3, 2)\n",
"ax = ax.flatten()\n",
"# set title\n",
"fig.suptitle('Joint Tunings - By Phase')\n",
"for i in range(6):\n",
" ax[i].plot(phase_linspace, res_reshaped.mean(1)[:, i])"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEVCAYAAADuAi4fAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAABwhUlEQVR4nO2dd3hb5dXAf68ky0PeeySemXZ2nIQEwoaEXQqU0QIFCgW6N12U7tKWftBCS4Gy27J3gbBJSAKxHTLsLDsesZ14T3lLer8/JDmKI9tatu4V9/c8eixfXd17rvTq3POec95zhJQSDQ0NDY3QRRdsATQ0NDQ0phZN0WtoaGiEOJqi19DQ0AhxNEWvoaGhEeJoil5DQ0MjxNEUvYaGhkaIoyn6zwhCCLMQIj/YcoyHEOJ+IcTPgy2HEhFCVAghTg22HABCiJ8IIR4Kthwa3qEpepUjhPhACPGVyfaTUkZLKas9PKYUQswa57WfOG4aZiHEoBDC6vJ/hbfyu8h3s5Ty176+fyoQQtwhhBhxub69QohL/DhevBDiH0KIJiFEvxBitxDiusneJ6UsklJ+4Ot5Xc5/hxDiSS/2P1UI0TBGlt9JKScdbxrKQlP0Gl7h+KFHSymjgZuBrc7/pZRFwZZvCnja5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lpbeIX64fh5CiNHtJ+Qn8eKta7j/S8uxSclNT5Rx6f1bqTjcHURpj+WN3Uf481sHuHhpFl87bdZxr89MjOKBa4p59LoVSODah7dx0+OlNHV75xp98dMGvvaf7RRlxTIjIZKqFnOArsDO41tr2X6oi19cUDj62wEQQnDOwgze/u7J/PTc+Ww/1Mn6uzfy85fK6RkcCag
"text/plain": [
"<Figure size 432x288 with 6 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(3, 2)\n",
"ax = ax.flatten()\n",
"# set title\n",
"fig.suptitle('Joint Tunings - By Orientation')\n",
"for i in range(6):\n",
" ax[i].plot(orientation_linspace, res_reshaped.mean(0)[:, i])"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7f13229a8970>"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAMUAAAD4CAYAAABc3CKDAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKs0lEQVR4nO3dXYic5RnG8evqrovJatBYW8wHTYRgm1psQvAjglATqVaphfYgUsVKS0+qRhFES1GQHvRARA9EkKgVDIYSAw0iRhuVUixbNQZMXCUhfmRNbFKDJmxbN4l3D2bSTu9ussm8T+Z9d/v/gWR3dnjmJuM/73y9+zgiBOA/vlT3AEDTEAWQEAWQEAWQEAWQ9Pfyxgb6psW0/hmV14mxgwWmwfHwwCnF1mrS/fZPjWosPvd4P+tpFNP6Z2jprB9XXufQBzsLTIPj0T9rbrG1mnS/DcXGo/6Mh09AQhRAQhRAQhRAUikK21faftf2dtt3lRoKqFPXUdjuk/SwpKskLZR0ne2FpQYD6lLlSHGhpO0RsS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EBCFEBCFEBCFEDyL77/vVudcwURAAAAAElFTkSuQmCC",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.imshow(res_reshaped[:, :, 0], cmap='viridis')"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## Persistence for different dimensions"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQwAAAEGCAYAAACQF6v1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAq2ElEQVR4nO3deXwV1d3H8c/Nnkgg7IGEVeCwKatstYqiKIi1Uh5RWgRLoYo8TxJQq1iqtbZgRSCtKIgboOAGVYsoCgXBqiggghAOgoIEkCVIQkhyE5Lz/HGTkORmuUnuPr/368XrlTszd+aXS/LNzJkz59iMMQghhCtCfF2AECJwSGAIIVwmgSGEcJkEhhDCZRIYQgiXhfm6gNrauXOniYyMrNc+7HY79d2HN0id7iV11uzIkSPk5OTQpk2b0/369WvutIExJqD+7d2719SXO/bhDVKne0mdVSsqKjJJSUkGMElJSWbbtm3bTCW/f3JJIoTFGWNISUkhNTWVpKQk5s+fX+W2EhhCWNz8+fPLhYXNZqty24BrwxBCuNfEiRMBSElJqTYsQM4whLAkYwxLliwhLy+PJk2aMH369BrDAiQwhLCckjaLKVOm8Morr9TqvRIYQlhI2QbO5ORkJk2aVKv3S2AIYREVw2LevHkuXYaUZalGzxc++Z75H+0n1FbEE2PiuLFnK1+XJITXpKens3z58jqHBYDNBNh4GG+//bZZsGBBuWW33XYbU6dOJScnh5EjRzq9Z+LEiQy6cTTDZ6/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x7t65KCiscCQ2t9Rw3
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"persistence.persistence(res, 1)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"# persistence.persistence(res, 2)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"# persistence.persistence(res, 3)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## PCA"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"res_df = pd.DataFrame(res[:limit], columns=['x' + str(i) for i in range(20)])"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"from sklearn.decomposition import PCA\n",
"import seaborn as sns"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:>"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiQAAAGuCAYAAACgMB1TAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAABnXUlEQVR4nO3de1iU1f428Hs4zAxKjCcEPABqCiqipKhIJe0Ui7J0V2IO2GGklMpM3e6ITDQ3UJEClXTYkr8QU3ZmB1PDSjJSMUjclqYmiSWgZDKI5nCY9f7h6+xGD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ODgYb731Fu68804cPHgQnp6e9fqnpKSY/U6ura3F8OHD8cADD5j1c3FxweHDh83a1Gp183yI/69ZfqMnJSWhtrYWWVlZyMzMbPBDvP/++4iLi8OGDRvQs2fPJvMSEhKg0WjMjrfOFDXH0ImIiKwnccrGYDCgsrLS7LjyH+WXrVixAjqdDrNmzcLgwYORnJyMvn37Ii0trcH+Go0G7u7upiM/Px9nz57FI488YtZPoVCY9XN3d5f+JbtSsxQkRUVFKCkpgdFoRHFxcb3nN2zYAJ1Oh6ysLEyYMOGqeTExMdDr9WbH4937N8fQiYiIrCdxyqahf4QnJCTUe8vq6moUFBTUWxIRGhqKXbt2WTTs1atXY8KECfDy8jJrr6qqgpeXF/r06YO77767RS4+kT5lU11dDa1Wi/DwcPj6+kKn0+HAgQNwc3MDcOnMyKOPPor3338fd911l0W
"text/plain": [
"<Figure size 640x480 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"sns.heatmap(res_df.corr())"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"Seems like we need about 5 components"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>PC1</th>\n",
" <th>PC2</th>\n",
" <th>PC3</th>\n",
" <th>PC4</th>\n",
" <th>PC5</th>\n",
" <th>PC6</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>-1.612520</td>\n",
" <td>-0.547999</td>\n",
" <td>-0.110458</td>\n",
" <td>-0.530344</td>\n",
" <td>0.888399</td>\n",
" <td>-0.105346</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>-1.007680</td>\n",
" <td>-0.069920</td>\n",
" <td>-0.222961</td>\n",
" <td>0.443805</td>\n",
" <td>-0.416626</td>\n",
" <td>-0.541131</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>-0.228229</td>\n",
" <td>0.523023</td>\n",
" <td>0.226259</td>\n",
" <td>-0.233582</td>\n",
" <td>-0.340139</td>\n",
" <td>-0.273262</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>-0.178205</td>\n",
" <td>0.297823</td>\n",
" <td>0.294549</td>\n",
" <td>-0.225669</td>\n",
" <td>-0.151865</td>\n",
" <td>0.018889</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>0.113908</td>\n",
" <td>-0.155210</td>\n",
" <td>0.616534</td>\n",
" <td>0.036769</td>\n",
" <td>0.003957</td>\n",
" <td>-0.032182</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" PC1 PC2 PC3 PC4 PC5 PC6\n",
"0 -1.612520 -0.547999 -0.110458 -0.530344 0.888399 -0.105346\n",
"1 -1.007680 -0.069920 -0.222961 0.443805 -0.416626 -0.541131\n",
"2 -0.228229 0.523023 0.226259 -0.233582 -0.340139 -0.273262\n",
"3 -0.178205 0.297823 0.294549 -0.225669 -0.151865 0.018889\n",
"4 0.113908 -0.155210 0.616534 0.036769 0.003957 -0.032182"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"N_COMP = 6\n",
"pca = PCA(n_components=N_COMP)\n",
"pca.fit(res_df)\n",
"data_pca = pca.transform(res_df)\n",
"data_pca = pd.DataFrame(data_pca, columns=[f'PC{i+1}' for i in range(N_COMP)])\n",
"data_pca.head()"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAEUAAAAVCAYAAAAQAyPeAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAEDUlEQVRYCeWY7VEbMRCGDUMBhhJMB3xUEOiAjwqADsLkF/zLkA5IKiBQQlJBAh2YDgJ0QJ5HnBSdTrbBGMgkOyOvtFqtdt9bre7cu7+/7+Xt6OhokI//9X4t3vleRsfHx+8ZrmSi/6E7aOJOsc6ZCRITW7B1+GEQjPhhXtAO4Ae5CuOB8kbWhzs+Qf6tkQXW6MU91hDe0A6RX+V6s+xj+6Swd5bvR99kuIN/Vi+AwsAgvsNXFY4jdIbMX8G3o16zXgAiKD36gnxO26Z/oS5coE7hm44l+jqsU5v0WwA6/xzCnvvpg6AH23DHK/Dl3DbjS8bv4HfzzYSOneZKtT4LdL5G+wj3mReISDHAD1EAd58EnHLWmDV3NJ2dNWnTrIi+aN8EuLZTkPGHjIqg7LAwpE6hmIbMe2x03laSqd+aQ7+mt4HekLl+YUCn+8h9sjMhbPmA9LkVF3IzMmVq3AyZeuLQX+DHxTXkon7ku+iahq0n7SQyg1qMio0sZk2egeqZujXAXFaCpWxa0k/rxKi9anbFYWeBH1HL06ujjGGPTR5cRycXoG9GhKNCPz0p+qkO5fr0w43H/CyL7Rp2r7Gp7V3aL5p15BzZqHiVbwqKi0cGjAFTWsQnZlPjgICs0wzwJ20sNWvcI95IY/WfMBmzbo09km36t7Q9Wij+hT0vkQ1riotvisl86PWbnnY+UfbR81b6RDMjzmiX9OMxKtXj2GJ44booeC7HVgTEo1r6/hX7XzKdfDtxGAjKEq167ljorTIyi5gbSaz1SWjXdI1OtvSRa9sUH3WsWvpTDGrZ7dWrP56QktTvC0qVcNSU9kaoGW6tQccnEupCa+LP8fFItQh9AV+Cd26CluIUA2zGhxx5zYrxlRQSxJpiytSepIt8wy3fHwzeV2PlPmXPq+j36C/SxjmimnoeqWV4yhD6wUn4xIcQjEz+sWjWAo8ra/uIw42gONlZjHMa7VRp5LfK4SkgxgKhrAQkpmiyg46g1j4nBCqdf/TM0tIeKo8mj2b5QF3sW7sXR/JJYUNmyrWgeEusN8LHMNG05ZSqexSyqUGqZ6EOwcEFX0cFsKxVG8hCsYW7zlvCwj3x0wPdDrHO4u0+fn4E/+Da3aHtdRY8CNzrao5PZ5+cxbD1LVAuYt4gDCrWBwvpD+QxEOV59qirQ+mJ0PfK62QlMqkFQKOrfJV+ANXBU4m1vi8JhmQmfERmInSo2fMg/JcCMEPB+dv+O8GnLVr/NfxinwFt6F7zDVzh7bMD3dsLrD1TZ8kT3feIicMDKGxsgfNGGZXa6r4q4Ysp76v5i1MTt/GHQh8zxY2tB2Xxe3GHxmzgXxEze8sds49Txp0+dNM/b840iG29ojNu+6ZErH7selOl95bf0TgbazrUwfgAAAAASUVORK5CYII=",
"text/latex": [
"$\\displaystyle \\left( 432, \\ 6\\right)$"
],
"text/plain": [
"(432, 6)"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data_pca.shape"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## UMAP decoding"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"# reducer = umap.UMAP()\n",
"# embedding = reducer.fit_transform(data_pca.to_numpy())"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"# %matplotlib notebook\n",
"# plt.scatter(\n",
"# embedding[:, 0],\n",
"# embedding[:, 1])\n",
"# plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"# embedding.shape"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## Cohomological decoding"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbkAAAGwCAYAAAA0WxvgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAABJAklEQVR4nO3deXhTVd4H8G+Wtmm60tANKFAWi+xQVlkrtizKNojrKzAuI268wDACMiPqOAMuo74OCqOIKDiKWkBEFAqloILQFWQpohRaoKUUuF1p0jb3/aM2NE1SuuTmZvl+nieP5uSk99f7hHx77j33HoUoiiKIiIjckFLuAoiIiKTCkCMiIrfFkCMiIrfFkCMiIrfFkCMiIrfFkCMiIrfFkCMiIrellrsARzMajbh48SICAgKgUCjkLoeIiJpJFEWUlpaiXbt2UCobH6t5XMhdvHgRUVFRcpdBREStlJeXhw4dOjTax+NCLiAgAEDtzgkMDJS5GiIiagpBEDB9+nRkZGQgODgYgiCYvs8b43EhV3eIMjAwkCFHROQi9Ho9DAYDdDodtm3bhhEjRjTplJPHhRwREbme0NBQJCcn49KlS+jYsWOT38fZlURE5JQEQUBiYqLpeWhoKHr37t2sn8GQIyIipyMIAhISEnD33Xdj/fr1Lf45DDkiInIqdQGXmpoKnU6HgQMHtvhnMeSIiMhpNAy45ORk9O3bt8U/jyFHREROwd4BBzDkiIjICVy/ft3uAQcw5IiIyAloNBrEx8fbNeAAQCGKomiXn+QiSkpKEBQUhOLiYl4MTkTkRERRREFBASIjIxvt15zvcY7kiIhIFoIgYMGCBaioqABQe0eqmwVcc/GOJ0RE5HD1J5lcvHgRmzZtkmQ7HMkREZFDNZxFuWzZMsm2xZGcxE5fKkXSyUsI8vXCX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KXaZT8oSAc9mJJ8XFxQCAkJAQm30OHjyIhIQEs7bx48cjLS3NdGK1vhUrViAoKMj0iIqKsm/RRGR3kZGR2DuvB7q0UeDMNREjP6yoDbg2Cux97znPDDhDBWA0NtpFFEVMnz7drQOuuZwm5ERRxMKFCzFy5MhGl1kvKChAeHi4WVt4eDiqq6tRVFRk0X/p0qUoLi42PfLy8uxeOxHZX0edFh9P8zVr+3iaLzq2C5OpIpnkpQL/GQP8MxJ4owdw2PbkEYVCgeXLl6Njx44MuN85zezKp59+GkePHsUPP/xw074KhcLsed0R14btAODj4wMfHx/7FElEDpMbkYBZW5PM2mZ9ZcDeZT3gMRPgrwvAxhmAvvYoF8ouATsWAYHtgR6TrL5l7NixOH36NLy9vR1XpxNzipHcM888g23btmHv3r3o0KFDo30jIiJQUFBg1lZYWAi1Wg2dTidlmUTkIPn5+Yib927tIcoQFX74oxZd2mpw5mo14hIm1s669AQnv74RcPVlbjT9ryAImDx5Mo4fP25qY8DdIOtIThRFPPPMM9iyZQtSUlIQHR190/cMHz4cX3/9tVnbrl27MGjQIHh5eUlVKhE5kE6nM5222Lt7FzpGhGDvC6WIi4tD7969PecPWmO1jfba+Qf1J5mcOXMGP//8M5RKpxi7OA1ZZ1c++eST+O9//4uvvvoKMTExpvagoCD4+tYei1+6dCkuXLiAjz/+GEDtJQS9e/fG448/jsceewwHDx7E3Llz8emnn2LGjBk33SZv60XkGgwGA65cuWI2ySQ/Px86nc5zRipll4G3+gDV183b//A+hI4Jbj+L0haXmV25evVqFBcXY+zYsYiMjDQ9Nm3aZOqTn5+P3Nxc0/Po6Gjs2LEDKSkp6N+/P/7+97/j7bffblLAEZHr8Pb2tphFGRkZ6TkBBwD+ocC9G4Cg389CevkBo5/16IB
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Decoding... done\n"
]
}
],
"source": [
"param_1 = decoding.cohomological_parameterization(res_df, coeff=12).to_numpy()"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x7f51aaf69b40>"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAXr0lEQVR4nO3df5RcZX3H8feHjUHFAGoipeQnHFCjSMU1iVqV1h+Q2JpY+4Mo9WeLVLFy1Jagqe2RWGvrD/SAptRSVEpirRJTjSK1jZ7WJrKxQIgIhABJAMkmgiAgmOXbP+6z6WWcH3d2Z3dmnnxe5+zZmec+88x379z9zMxz79xRRGBmZnk5pNsFmJlZ5znczcwy5HA3M8uQw93MLEMOdzOzDDnczcwy5HA3a0DSKkl7Jf2427V0mqS5kkLSlG7XYhPD4Z4BSbdJekjSzyTdLemfJD2p23U1M1HhIuliSTdKelTSm8YxzizgPcD8iPiVBn0Ol3SBpJ1p3W9P16en5X33uFg+HO75+O2IeBJwMvB8YGU7N1ahb7aHJk8K1wJvB34wzruYA+yLiD0N7n8q8G3gWcBpwOHAC4F9wIJS13E9LmZj1Tf/zFZNRNwBfAN4tqQnS/qapGFJ96TLM0f7Stoo6UOS/ht4EDhW0psl3SDpfkk7JL2t1P8USbsl/bmkPZLukrRM0hJJN0n6iaT3lfofImmFpFsk7ZP0L5KekhZ/N/2+N72yfUG6zVvS/d8j6UpJc0rjhaR3SLoZuLnB339RRHwb+HmrdSXpCEmfT+vndkkrU80vB64CfjXVdmmdm78BmA28JiJ+GBGPRsSeiDg/IjY0e1zq1LFC0r/WtH1S0qfS5Telx+J+SbdKen2rvy3dbqOkD0v6vqSf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adata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"%matplotlib inline\n",
"plt.title(\"Parameter 1 of CP vs. phase\")\n",
"plt.scatter(phi_deg, param_1)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x7f51aafa6bc0>"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEICAYAAABPgw/pAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAYeElEQVR4nO3df5TddX3n8ecrkwBTCEZMZEkICbAYGysITgPbdpXdgvnh6SYe6ymoVVxb5CiuntrUoFmLokU36672FEupS/2BkNUSYlrRkdpST+WATBogRDoYfiYTlgw/piBOJZm894/vZ8LNzf01kzu59/vJ63HOnLnfz/dz733fz/18X/O93++9dxQRmJlZ+U3rdAFmZtYeDnQzs0w40M3MMuFANzPLhAPdzCwTDnQzs0w40C17kj4t6SlJ/6/TtRwOkj4m6cudrgNA0imSfiapp9O1HAkc6F1E0qOSRtMG8KSkv5J0XKfrakTSQkkhaXqbb/c6SYOS9km65BBuZz7wEWBxRPy7On2Ol/QFSY+nsd+elmen9aV6XiLiTyLi9w71dibz3KaxuqCilscj4riIGDvUeqw5B3r3+a2IOA44B/hVYO1ErqxCaZ7XBmFxL/B+4J8P8S4WAE9HxO46938U8APgNcAy4Hjg14CngSUVXQ/peTlc2v2H1cqlNBv+kSYihoDvAr8i6eWS/lbSsKRn0+WTx/tKul3SZyT9CPg5cJqk90h6QNLzkh6W9L6K/udL2inpjyTtlvSEpFWSVkh6UNIzkj5W0X+apDWSHpL0tKRvSjohrf5h+j2S9mD/Q7rOf033/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ain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.title(\"Parameter 1 of CP vs. orientation\")\n",
"plt.scatter(theta_deg, param_1)"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"data_without_features = decoding.remove_feature(data_pca.to_numpy(), pd.DataFrame(param_1))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQwAAAEGCAYAAACQF6v1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAveElEQVR4nO2dd3zV5fXH3ycJWYCMhL1RUAERMDKcWBEFcSFai4tqRaW2JKBWcZS6aB1A+nMB1brQui0qFMUiYkEEMYAsBRQJICNhBTJIcn5/fLNu7k1ySXL3eb9e9+X3Gd/v93hJPnme85znPKKqGIZheENUoA0wDCN0MMEwDMNrTDAMw/AaEwzDMLzGBMMwDK+JCbQBx0pycrJ27tw50GYYRliybds2cnNzOXTo0F5VbVG5PeQEo3PnzqxYsSLQZhhGWKGqpKWlkZ6ezvjx40lPT9/qqZ9NSQwjwqksFtOmTauyrwmGYUQ406ZNcxELEamyb8hNSQzDqF/GjBkDQFpaWrViATbCMIyIRFWZNWsWeXl5NG/enAkTJtQoFmCCYRgRR6nPYuzYsbz22mvHdK8JhmFEEBUdnKmpqdx8883HdL8JhmFECJXFYurUqV5NQyoSUU7PF778kWmffk9cTBSPXtGLi3q1CbRJhuE3MjMzefXVV2stFgASavkwGjdurKeddppL3dVXX824ceM4cuQIw4cPd7tnzJgxDLxoJEOnfMTu96cAECXCaZ2a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YYA5OOubQK+SGIZPefjhh00s6hELDTfCmtGjRwPwwAMPmFjUAzb
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Decoding... "
]
}
],
"source": [
"param_2 = decoding.cohomological_parameterization(\n",
" pd.DataFrame(data_without_features[:limit])).to_numpy()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"plt.scatter([phi_deg[i] * 180 / np.pi for i in phi_reorder], [param_2[i] for i in phi_reorder])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"plt.scatter([theta_deg[i] for i in theta_reorder], [param_2[i] for i in theta_reorder])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"phi_reorder[:10]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.10.5 64-bit",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.5"
},
"vscode": {
"interpreter": {
"hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a"
}
}
},
"nbformat": 4,
"nbformat_minor": 0
}