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.

765 lines
325 KiB

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Simulating data points: 100%|██████████| 324/324 [00:11<00:00, 28.10it/s]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAARMAAAEGCAYAAABGsnGQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAmPklEQVR4nO3deXwV9b3/8dcnO6uQgIgCJi6ACooQNaBXqOACongFkcUFKoIgQoDeKl7p6vprTVzuFUWtcK1bBYsILq2IthaqBqWsxgVRQkECQRBCyCT5/P6YE8i+nnPmLJ/n45EHmZkzMx8G8s53vjPzHVFVjDGmuWK8LsAYExksTIwxfmFhYozxCwsTY4xfWJgYY/wizusCmqNDhw6amprqdRnGRBxVZevWrcTExFBQULBHVTvWt05Yh0lqaio5OTlel2FMRHEch7Fjx/Lpp5+SlZXF7Nmzv23IenaaY4w5qjxIlixZQlZWFrNmzWrwugELExH5g4jsFpGNFeYli8hfReRL35/tffNFRB4Tka9EZL2I9A1UXcaY2s2ZM6dJQQKBbZksBK6oMu8uYKWqng6s9E0DDAVO931NBuYHsC5jTC1mz57N008/3egggQCGiar+DSioMnsEsMj3/SLgmgrz/09d/wTaiUjnQNVmjDnGcRwWLFhAWVkZqampTJo0qUnbCXafSSdV3en7fhfQyff9ScD2Cp/L882rRkQmi0iOiOTk5+cHrlJjokB5H8mUKVNYuXJls7blWQesuk8YNvopQ1VdoKrpqpresWO9V6uMMbWo2NmanZ3NpZde2qztBTtMvi8/ffH9uds3fwfQtcLnuvjmGWMCoGqQZGZmNnubwQ6TZcDNvu9vBl6vMP8m31WdDGB/hdOhgLhvxWbOmPc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C7PCgNmOaLi4ROp11dDKSO1tr4sXVnO+ADBFpKW57bzCwGVgFjPJ95mbgdQ9qM8Zv5s6dGzVBAh60TFT1IxFZDHwKlACf4Z62rABeFpF7ffOeDXZtxvjTnDlz6NWrFxMmTPC6lKCwB/2M8SPHcZg/fz7Tpk0jLi4y7glt6IN+9myOMX5S3kcyc+bMoyOlRRMLE2P8oGJna1ZWFldeeaXXJQWdhYkxzVQ1SGbNmuV1SZ6wMDGmmXJzc3nnnXeiOkjAnho2pslUFRGhV69efPHFF3Tu3NnrkjxlLRNjmsBxHEaPHs2jjz4KEPVBAhYmxjRaeR/J4sWLKSsr87qckGFhYkwjWGdr7SxMjGkgVWXcuHEWJLWwDlhjGkhEuPjiixkwYIAFSQ0sTIyph+M45Obm0qtXr7B5768X7DTHmDqU95H079+fnTt3el1OSLOWiQldzmH3Xb1tOkG7bsHffZXxSOzyb90sTExoOrwP/jAU8re446uedhlc+bughUq0DWzkD3aaY0LTuhfdIAHQMvjybXjsXNj2j6Ds/sknn7QgaSRrmZjQVHW0d3DfSbP6MUi9MOC7nzp1KqeeeirDhg0L+L4ihbVMTGg69wZo26X6/PgW1ec5RfDN3+H7Tc3apeM4zJkzh507dxIXF2dB0kgWJiY0JbZxX615+mUc/W8a3xLycuCVG6CwwJ1XXAjPXQGLhsP8AfD3rCbtrryPJCsri7fffts/f4coY2FiQld8Eox/Feblw0WzwSmE/dthyxvw1p3uZz5fDv/+7Ng6q+6HstJG7aZqZ+vEiRP9+JeIHhYmJvTFxsGhKi9cK/jatyy+ymfja+5vqYVdtfEfCxMT2nZ8Cs8Mga9XVZ7fw9ef0fMq6O57h1tMPFyZBSJQdKDy58tKa2yxHDhwgNzcXAsSP7CrOSZ0lZXCi9fDod3utAicfT2kDYI+Y915sXEw9mX44Tu3n6WsFJ68CHZtgORT4Ib
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Decoding... done\n"
]
}
],
"source": [
"# -*- coding: utf-8 -*-\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
"\n",
"import sys\n",
"sys.path.insert(0, './Persistent_Homology')\n",
"\n",
"from gratings import grating_model\n",
"from plotting import plot_data, plot_mean_against_index, show_feature\n",
"from persistence import persistence\n",
"from decoding import cohomological_parameterization, remove_feature\n",
"from noisereduction import PCA_reduction, z_cutoff\n",
"\n",
"\n",
"\n",
"## Generate data\n",
"data = grating_model(Nn=8, Np=(18,1,18,1), deltaT=55) #, random_neurons=True\n",
"\n",
"## Apply noise reduction\n",
"# data = PCA_reduction(data, 5)\n",
"# data = z_cutoff(data,2)\n",
"\n",
"## Analyze shape\n",
"# persistence(data,homdim=2,coeff=2)\n",
"# persistence(data,homdim=2,coeff=3)\n",
"\n",
"## Decode first parameter\n",
"decoding1 = cohomological_parameterization(data, coeff=23)\n",
"# show_feature(decoding1)\n",
"# plot_data(data,transformation=\"PCA\", labels=decoding1,\n",
"# colors=[\"Twilight\",\"Viridis\",\"Twilight\",\"Viridis\",\"Twilight\"])\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjcAAAG2CAYAAACDLKdOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAzgUlEQVR4nO3df3RU9Z3/8ddMJBkpYSRAMgNGibH+mIYfBpp8g1rLNjRZbSq72y3VIpRVu6bWiqlVqJbp1K2h1FK6LcJWq3SLrrS1ukbsoI2iR003lUBLDGKBKG47ScToJIaG0Jn7/YPNyDQTSCaTuZM7z8c5c47zmc8d3nPPOHmdz+fez8dmGIYhAAAAi7CbXQAAAEAiEW4AAIClEG4AAIClEG4AAIClEG4AAIClEG4AAIClEG4AAIClEG4AA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EGAACLyc12JLTfWEO4AQDAYkoKcuR2OjTYDd82Hb9rqqQgJ5llJQ3hBgAAi8mw2+St8kjSgIDT/9xb5bHsejeEGwAALKiyyK2NS4rlckZPPbmcDm1cUmzpdW5YxA8AAIuqLHJrocfFCsUAAMA6Muw2lRVONruMpGJaCgAAWArhBgAAWArhBgAAWArhBgAAWArhBgAAWArhBgAAWArhBgAAWArhBgAAWArhBgAAWAorFAMAYIJQ2Ei7bRGShXADAECS+ZsD8tW1KBDsjbS5nQ55qzyW3tAyWZiWAgAgifzNAVVvaYoKNpLUFuxV9ZYm+ZsDJlVmHYQbAACSJBQ25KtrkRHjtf42X12LQuFYPTBUhBs
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjcAAAG2CAYAAACDLKdOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAtkklEQVR4nO3df3RU9Z3/8ddkIBlZk5EQkxkwQkSoZiPhR0yMyKo1CJWN0m7bFEU4VO2aBUXSngJFiHG3xrpqsUpDwba6y0HS9aw/UBvkRMFDDRshxjVGUTA1HM0PIdtJjCaxM/f7B9+MTJNIMpnMnbl5Ps6Zc5zPfG7ue0ZgXvl8PvdzbYZhGAIAALCIGLMLAAAACCXCDQAAsBTCDQAAsBTCDQAAsBTCDQAAsBTCDQAAsBTCDQAAsBTCDQAAsBTCDQAAsBTCDQAAsBRTw81rr72m/Px8TZw4UTabTc8+++wZj9m3b59mz56tuLg4XXjhhXriiSdGvE4AABA9TA03nZ2dyszM1JYtWwbVv6GhQYsWLdLVV1+t2tpa3XXXXbr11lu1Z8+eEa4UAABEC1uk3DjTZrPpmWee0eLFiwfss3btWr344ouqq6vzt/3gBz/QX/7yF1VUVIShSgAAEOnG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QAAlkK4AQAAlkK4AQAAlkK4AQAAlkK4AQAAlkK4AQAAlkK4AQAAlkK4AQAAlkK4AQAAlkK4AQAAlkK4AQAAlmJ6uNmyZYumTJkih8OhnJwcVVdXf23/v/zlL1q5cqXcbrfi4uI0ffp0vfTSS2GqFgAARLoxZp68vLxcRUVF2rp1q3JycrR582Y
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plot_mean_against_index(data,decoding1,\"orientation\")\n",
"plot_mean_against_index(data,decoding1,\"phase\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAb0AAAGwCAYAAAA9sLuaAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABGO0lEQVR4nO3deVhU9f4H8PdhYAaQTVE2BcXEPcUt15uZ3ItbpqKlPyrUrnZRy/WWVlp6M8tuZmqm1E0zy0qvtpjaNdzSFBRcc18hESgREGSd8/39QYwOzCDLzJxZ3q/nmac45ztzPodH5+0557tIQggBIiIiB+CkdAFERESWwtAjIiKHwdAjIiKHwdAjIiKHwdAjIiKHwdAjIiKHwdAjIiKH4ax0AdZAlmWkpaXB09MTkiQpXQ4REdWAEAK3b99GUFAQnJyqvpZj6AFIS0tDcHCw0mUQEVEdpKamokmTJlW2YegB8PT0BFD2C/Py8lK4GiIiuh9ZljFjxgysWbNGt638u7wqDD1Ad0vTy8uLoUdEZAO0Wi2KioogSRJWr16NiRMnVuvxlMS5N4Hc3Fx4e3sjJyeHoUdEZCO0Wi0OHDiA8PDwan+Hs/cmERHZBFmWsW7dOmi1WgCASqXCww8/XKPPYOgREZHVk2UZkyZNQkxMDCZMmFDrz2HoERGRVSsPvNWrV0OSJDz66KO1/iyGHhERWa2K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MkcYllCVmnyHc8JpcMJpIrJdHHjOCaeJiBzGpk2bHDrwakrRZ3pERFQ3o0aNwi+//IKuXbsy8Kq
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Decoding... done\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjcAAAG2CAYAAACDLKdOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAtr0lEQVR4nO3df3RU9Z3/8dckJBkpZPidBIyCoGgKhF8mG9RFajCsNsrudpvqCpRFu3JQwdRqqEpMaQ1SpXQryqoVXH+s+KNSFRq0UfSocVFCXBBE+aFhbX4A0QkESXDmfv/gm4ExCWQmk7kzn3k+zplzzGc+d+Y994xzX3zu536uw7IsSwAAAIaIs7sAAACAUCLcAAAAoxBuAACAUQg3AADAKIQbAABgFMINAAAwCuEGAAAYhXADAACMQrgBAABGIdwAAACj2Bpu3n77beXn52vw4MFyOBxau3btabfZuHGjxo8fr6SkJI0YMUKrV6/u9joBAED0sDXcNDU1KTMzUytWrOhU/7179+rKK6/UlClTVFVVpQULFuj666/Xhg0burlSAAAQLRyRcuNMh8Ohl156SdOnT++wzx133KF169Zp27Ztvraf/OQn+vrrr1VWVhaGKgEAQKTrYXcBgaioqFBubq5fW15enhYsWNDhNs3NzWpubvb97fV61dDQoP79+8vhcHRXqQAAIIQsy9KhQ4c0ePBgxcWd+sRTVIWb2tpapaSk+LWlpKSosbFR33zzjc4444w225SWlqqkpCRcJQIAgG60b98+nXnmmafsE1XhJhgLFy5UYWGh72+3262zzjpL+/btU3Jyso2VAQCAzmpsbFR6erp69+592r5RFW5SU1NVV1fn11ZXV6fk5OR2R20kKSkpSUlJSW3ak5OTCTcAAESZzkwpiap1bnJyclReXu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9NGpenh68Yr1eV/6inV5dTD142PyhEpAMfZOucGQGQL5KqinOH9w1dYiEwblaapGanGzCUCcBzhBkCHYuGqovg4R1QGMwAd47QUgA5xVRGAaES4AdChrGH9lOZytpl028qh41dNZQ3rF86yAOCUCDcAOsRVRQCiEeEGwClxVVFoeLyWKnYf1J+rvlTF7oNReYUZEC2YUAzgtLiqqGtMWwQRiHSsUAwA3ah1EcTv/tC2xkJGv4DOYYViAIgAJi+CCEQywg0AdJNAFkEEEDqEGwDoJrGwCCIQiZhQDHQDj9di8i1YBBGwCeEGCDGujEGr1kUQa91H251349DxS+pZBBEILU5LIaZ091ojrVfGfHeeRa37qOY+VamybTUhfT9ENhZBBOzByA1iRnePqJzuyhiHjl8ZMzUjlYNZDGldBPG7371URvOAbkO4QUzoaK2R1hGVUKw1EsiVMdyFOraEexFE5nwh1hFuYLxwjahwZQxOJT7OEZZQy5wvgDk3iAHhWmuEK2NgN+Z8AccRbmC8cI2otF4Z09HYj0PH/wXNlTHoDqyGDJxAuIHxwjWiwpUxsBOrIQMnEG5gvHCOqLReGZPq8g9KqS4nN0hEt2LOF3ACE4phvNYRlblPVcoh+Q3bd8eISrivjAEk5nwBJ2PkBjEh3CMqrVfGXD12iHKG9yfYoNsx5ws4gZEbxAxGVGCycI9QApHMYVlWTE2db2xslMvlktvtVnJyst3lAEBIsc4NTBXI8ZuRGwAwSDhHKFkJGZGKcAMAhgnHasiMECGSMaEYABAQk1dC9ngtVew+qD9XfamK3QdZ9DBKMXIDAOi0cN2rzQ6MRpmDkRsAQKeZuhKyyaNRsYhwAwDoNLtWQu7O00Xcl8s8nJYCAHSaHSshd/fpokBGo7p7ojZCg5EbAECnhXsl5HCcLuK+XOYh3AAAOq11JWRJbQJOqFdCDtfpIu7
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjcAAAG2CAYAAACDLKdOAAAAOXRFWHR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pOv1CtJ/QJO33NfqZd+N0CSItwAGJdKcj2qWpYnt8sZNe52ObkNHEhySdXEDwBiqSTXo8VeNx2KAYsh3AAY1xx2GxcNAxbDshQAALAUwg0AALAUwg0AALAUwg0AALAUwg0AALAUwg0AALAUwg0AALAU+twASDihsEFjPQAjRrgBkFD8jQFVVDcpEOyJjHlcTvlKvWyJAGBIWJYCkDD8jQGV7ayPCjaS1BrsUdnOevkbAyZVBiCZEG4AJIRQ2FBFdZOMAV7rG6uoblIoPNAMAPgc4QZAQqhr7uh3xuZkhqRAsEd1zR3xKwpAUiLcAEgI7V2DB5uRzAMwfhFuACSEzDRnTOcBGL8INwASQkFOhjwupwa74dumE3dNFeRkxLMsAEmIcAMgITjsNvlKvZLUL+D0PfeVeul3A+CUCDcAEkZJrkdVy/LkdkUvPbldTlUty6PPDYAhoYkfgIRSkuvRYq+bDsUARoxwAyDhOOw2Fc2aYnYZAJIUy1IAAMBSCDcAAMBSCDcAAMBSCDcAAMBSCDcAAMBSCDcAAMBSuBUcwJCEwga9ZwAkBcINgFPyNwZUUd2kQPDzHbk9Lqd8pV66BgNIOCxLAfhS/saAynbWRwUbSWoN9qhsZ738jQGTKgOAgRFuAAwqFDZUUd0kY4DX+sYqqpsUCg80AwDMQbgBMKi65o5+Z2xOZkgKBHtU19wRv6IA4BQINwAG1d4
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Decode second parameter\n",
"reduced_data = remove_feature(data, decoding1, cut_amplitude=0.5)\n",
"decoding2 = cohomological_parameterization(reduced_data, coeff=23)\n",
"# show_feature(decoding2)\n",
"plot_mean_against_index(data,decoding2,\"orientation\")\n",
"plot_mean_against_index(data,decoding2,\"phase\")\n",
"# plot_data(data,transformation=\"PCA\", labels=decoding2,\n",
" # colors=[\"Twilight\",\"Viridis\",\"Twilight\",\"Viridis\",\"Twilight\"])"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# Klein bottle\n",
"R = 25\n",
"r = 12\n",
"N = 20\n",
"data_4D_klein_bottle = []\n",
"phase = np.linspace(0,2*np.pi, N)\n",
"orientation = np.linspace(0, np.pi, N)\n",
"for phi in phase:\n",
" for theta in orientation:\n",
" x1 = (R + r*np.cos(phi)) *np.cos(2*theta)\n",
" x2 = (R + r*np.cos(phi)) *np.sin(2*theta)\n",
" x3 = r*np.sin(phi)*np.cos(theta)\n",
" x4 = r*np.sin(phi)*np.sin(theta)\n",
" data_4D_klein_bottle.append([x1, x2, x3, x4])"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# Klein bottle\n",
"R = 25\n",
"P = 8\n",
"N = 20\n",
"eps = 0.8\n",
"data_4D_klein_bottle = []\n",
"phis = np.linspace(0,2*np.pi, N)\n",
"vs = np.linspace(0, 2*np.pi, N)\n",
"param = []\n",
"for phi in phis:\n",
" for v in vs:\n",
" param.append([phi, v])\n",
" x1 = R * (np.cos(phi/2) * np.cos(v) - np.sin(phi/2)*np.sin(2*v))\n",
" x2 = R * (np.sin(phi/2) * np.cos(v) + np.cos(phi/2)*np.sin(2*v))\n",
" x3 = P*np.cos(phi)*(1 + eps * np.sin(v))\n",
" x4 = P*np.sin(phi)*(1 + eps * np.sin(v))\n",
" data_4D_klein_bottle.append([x1, x2, x3, x4])\n",
" \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$x_1 = (R + r\\cos(\\phi))\\cos(\\theta),\\\\\n",
" x_2 = (R + r\\cos(\\phi))\\sin(\\theta),\\\\\n",
" x_3 = r\\sin(\\phi)\\cos(\\theta/2)\\\\\n",
" x_4 = r\\sin(\\phi)\\sin(\\theta/2) $"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"4D non-intersecting parametrization\n",
"$ x1 = R(\\cos(\\phi/2) \\cos(v) - \\sin(\\phi/2) \\sin(2v)) \\\\\n",
"x2 = R(\\sin(\\phi/2) \\cos(v) + \\cos(\\phi/2) \\sin(2v)) \\\\\n",
"x3 = P\\cos(\\phi)(1+\\epsilon \\sin(v))\\\\\n",
"x4 = P\\sin(\\phi])(1+\\epsilon \\sin(v))\n",
"$"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"data_4D_klein_bottle = pd.DataFrame(np.array(data_4D_klein_bottle))\n",
"param = np.array(param)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(400, 4)"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data_4D_klein_bottle.shape"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbQAAAGwCAYAAADBpZBQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABMQElEQVR4nO3deVhUZf8G8Psw7IsIqCyKooKaGygqaJqYpGhpmpaZCaapb1m9Zqb5K9d8U+vVyi1LS5MxUys1rSwjhdfcwTV3RcEQEJFV1pnz+2NidJgZZJmZMzPcn+ua6+I888ycr+Nwbs6ZZ55HEEVRBBERkYWzkboAIiIiQ2CgERGRVWCgERGRVWCgERGRVWCgERGRVWCgERGRVWCgERGRVbCVugBjUyqVSEtLg5ubGwRBkLocIiKqIVEUkZ+fDz8/P9jY6D8Ps/pAS0tLg7+/v9RlEBFRHaWmpqJZs2Z677f6QHNzcwOgeiEaNGggcTVERFQdW7ZswaRJkwAAY8aMwaZNm9THc32sPtAqLjM2aNCAgUZEZCHKy8sBAJMnT8bixYuxadOmh35sZPWBRkRElueVV15B+/bt0adPHxQUFFTrMRzlSEREZmHnzp3IyspSb/ft27fKQSCVMdCIiEhycrkcw4cPR2RkJPLy8mr1HAw0IiKSlFwuR3R0NER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HLp0iWsW7dO6nIsDgONiMgMVB7NOGfOHKlLsjgMNCIiiXFovmHwFSMikhDDzHD4qhERSaS0tBQffPABw8xA+D00IiKJ2NvbIy4
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbQAAAGwCAYAAADBpZBQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABMQElEQVR4nO3deVhUZf8G8Psw7IsIqCyKooKaGygqaJqYpGhpmpaZCaapb1m9Zqb5K9d8U+vVyi1LS5MxUys1rSwjhdfcwTV3RcEQEJFV1pnz+2NidJgZZJmZMzPcn+ua6+I888ycr+Nwbs6ZZ55HEEVRBBERkYWzkboAIiIiQ2CgERGRVWCgERGRVWCgERGRVWCgERGRVWCgERGRVWCgERGRVbCVugBjUyqVSEtLg5ubGwRBkLocIiKqIVEUkZ+fDz8/P9jY6D8Ps/pAS0tLg7+/v9RlEBFRHaWmpqJZs2Z677f6QHNzcwOgeiEaNGggcTVERFQdW7ZswaRJkwAAY8aMwaZNm9THc32sPtAqLjM2aNCAgUZEZCHKy8sBAJMnT8bixYuxadOmh35sZPWBRkRElueVV15B+/bt0adPHxQUFFTrMRzlSEREZmHnzp3IyspSb/ft27fKQSCVMdCIiEhycrkcw4cPR2RkJPLy8mr1HAw0IiKSlFwuR3R0NERRRHh4OFxdXWv1PAw0IiKSzINhNnnyZKxevbpGlxkfxEAjIiJJGDLMAAYaERFJYOvWrQYNM4DD9omISAKhoaFo2rQpnnzySYOEGcBAIyIiCbRu3RrHjh1DkyZNDBJmAC85EhGRicjlcuzevVu97ePjY7AwA3iGRkREJlAxAMTW1hbHjh1DcHCwwffBMzQiIjKqB0czjh8/Hp06dTLKfniGZkDFZQrsOZuO1Ox7CG/the4Bn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dPXv21DnCkYiI7vv222/rTZgBEgfaZ599BgCIiIjQaF+/fj3GjRsHAPj4449hY2ODESNGoKSkBAMHDsTq1atNXCkRkeXp0KEDvLy8MGLECKsPM8DMvodmDNX9/gIRkTVKSUlBs2bNLDrMLPJ7aEREVDebNm1CQkKCert58+YWHWY1YTbD9omIqG4qBoA4OzsjMTERbdu2lbokk6ofsU1EVEclihJk3ss0m3XCcopzkFeap95+cDTjiy++iKCgIAmrkwbP0IiIHmLt6bVYf3Y98svy0aJBC7wX/h7CfaUZaZ1VlIX3DryHg2kHIQgC+jfvj0euP4LJ4yfXm9GM+nBQCBFRFfYk78HbCW9rtDnZOuHXEb/Cw9HD5PW8/NvLOHLriHo752AObq69CYiw2jDjoBAiIgPYfW23VltReRHiUuJ09DaurKIsjTArOFegDrOJkyZaZZjVBC85EhFVQRAE3e3Q3W5Kzm2c4RbiBvuG9lixckW9DjOAZ2hERFUa2nqoVpuLnQsiW0Tq6G1cjZwa4dGmj6q3bWxt0HxKc0yaNwkOdpyUnYFGRFSFJ1o8gendpsPDQfV5WZBHEFb1XwV3B3dJ6umS2gWyH2UQIMDWxhZPtXkK7/Z8V5JazA0HhRARVUO5shyFZYWSBRmgOTR/46aNGPncSDjZOklWj6lU9zjOz9CIiKrB1sbWbMJs8uTJGPP8mHr/mVllfDWIiMxcfVoCpi74ihARmTGGWfXxVSEiMlOpqakYP348w6ya+BkaEZGZ8vf3R2xsLBISErBiBb9n9jAc5UhEZGZKSkrg4MDvlVXg1FdERBZILpejc+fOuHnzptSlWBwGGhGRmagYAHLp0iWsW7dO6nIsDgONiMgMVB7NOGfOHKlLsjgMNCIiiXFovmHwFSMikhDDzHD4qhERSaS0tBQffPABw8xA+D00IiKJ2NvbIy4
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"## Apply noise reduction\n",
"# data = PCA_reduction(data, 5)\n",
"# data = z_cutoff(data,2)\n",
"\n",
"## Analyze shape\n",
"persistence(data_4D_klein_bottle,homdim=2,coeff=2)\n",
"persistence(data_4D_klein_bottle,homdim=2,coeff=3)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAcMAAAGwCAYAAADVMA6xAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABUSklEQVR4nO3deVxU9f4/8Ncw7AKDsg0oKq64YqKiZqlJAgYukZl5E9P0/kr7VmSmlUvWDcts8Wra7V63W2lqLrnkTUbFq6KGqGm5i+LCkgsMIAwwc35/zGVkZAZZZubM8no+HvOI8zmfc857JpiX55zPOUciCIIAIiIiB+YkdgFERERiYxgSEZHDYxgSEZHDYxgSEZHDYxgSEZHDYxgSEZHDYxgSEZHDcxa7AGuk0Whw8+ZNeHt7QyKRiF0OERHVkyAIKCoqQkhICJycHr7fxzA04ObNmwgNDRW7DCIiaqRr166hRYsWD+3HMDTA29sbgPZD9PHxEbkaIiKqi3379uHZZ5+FSqXCkCFDoFAodN/nD8MwNKDq0KiPjw/DkIjIhmg0GsTHx2PFihUIDAys86kuUQfQpKSkoHfv3vD29kZgYCBGjhyJc+fO6fUpKyvD1KlT4efnBy8vLyQmJiIvL6/W9QqCgDlz5iA4OBgeHh6Ijo7GhQsXzPlWiIhIZMOHD8e+ffuwceNGuLm51WtZUcMwLS0NU6dOxeHDh7F7925UVFRg6NChKCkp0fV54403sG3bNmzYsAFpaWm4efMmnn766VrX+8knn2Dx4sVYvnw5jhw5giZNmiAmJgZlZWXmfktERGRB+/btw+XLl3XT/fv3r3cQAgAEK5Kfny8AENLS0gRBEISCggLBxcVF2LBhg67PmTNnBABCenq6wXVoNBpBLpcLCxcu1LUVFBQIbm5uwtq1a+tUR2FhoQBAKCwsbMS7ISIic0pNTRXc3d2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33e9KffpWVFSgvLzcaF83Nzc4OzvXu29lZSVUKpXRvq6urnBxcal3X7VaXesN711cXODq6lrvvhqNBqWlpSbp6+zsrPvyFAQB9+7dM0nf+vzdm+o74mF97e07Ii8vTxeEcXFxWL16NSorKw3+TT/s7762z9EgE94z1W5U3eDV2GvYsGF6/T09PY32HThwoF5ff39/o31d5e2FVm9vF/624w9BEAShVatWRvt27txZb72dO3c22rdVq1Z6fXv16mW0r7+/v17fgQMHGu3r6emp13fYsGG1fm7VPfPMM7X2LS4u1vVNSkqqtW9+fr6u7yuvvFJr36ysLF3f6dOn19r39OnTur5z586tte/Ro0d1fT/55JNa++7du1fXd8mSJbX23b59u67vypUra+27fv16Xd/169fX2nflypW6vtu3b6+175IlS3R99+7dW2vfTz75RNf36NGjtfadO3euru/p06dr7Tt9+nRd36ysrFr7vvLKK7q+VTf/N/ZKSkrS9S0uLq617zPPPKP3O1xbX3N9R/Tq1Uuvr719R2g0GmHOnDlCfHy88PTTT9fat67fETZ5o27SCvNv8vBORER2RiKRYN68edi8ebPuqIzFtv2/f+FQNVVDcm/evGlwSK6pDoHcLlZh9PJDyCn83yEqiQQdmvvhp2mPwtPV2e4OgfAwac2+PEzKw6SOfph07969WLJkCf79738jICCg1r7VPezvXqlUIiQkpM6XVjAMDbDkdYb5RWVYfegKzucVo1tzGZL6tYbM08Ws2yQisgbVB8vMnTsX8+bNM9m66/s9zjA0gBfdExGZl7lHjfKieyIismpiXT5RG4YhERFZjDUGIcAwJCIiCykrK0NSUpLVBSHAMCQiIgtxd3fHTz/9hBdeeMGqghDgABqDOICGiMh07t27p3fphiVwAA0REVmN1NRUtGnTBunp6WKXUiuGIRERmUVqaioSEhKQl5eHv//972KXUyuGIRERmVxVEFYNllm5cqXYJdWKYUhERCb1YBBa22AZQxiGRERkMrYYhADDkIiITGjZsmU2F4QAw5CIiEzou+++w4cffmhTQQgwDImIqJHOnz+vezyUu7s73n33XZsKQoBhSEREjaBQKBAREYHp06cbfV6iLWAYEhFRg1S/6fb58+drfbC2tWMYEhFRvRl6+oSLi+0+mJxhSERE9WKtj2FqDIYhERHVmT0GIcAwJCKierh58yZUKpVdBSEAOItdABER2Y4XXngBcrkcjz/+uN0EIcA9QyIieoj9+/cjJydHN/3kk0/aVRACDEMiIqqFQqFATEwMnnjiCeTn54tdjtmIGob79+9HQkICQkJCIJFIsGXLFr35EonE4GvhwoVG1zlv3rwa/cPDw838ToiI7E/1wTLt2rWDTCYTuySzETUMS0pKEBERgaVLlxqcn5OTo/dasWIFJBIJEhMTa11vly5d9JY7cOCAOconIrJb9jpq1BhRB9DExcUhLi7O6Hy5XK43vXXrVgwePBht2rSpdb3Ozs41liUiorpxtCAEbOicYV5eHnbs2IFJkyY9tO+FCxcQEhKCNm3aYNy4ccjOzq61v0qlglKp1HsRETmitLQ0hwtCwIbCcPXq1fD29sbTTz9da7+oqCisWrUKu3btwrJly5CVlYXHHnsMRUVFRpdJSUmBTCbTvUJDQ01dPhGRTWjbti2aN2/uUEEIABLBSm4zLpFIsHnzZowcOdLg/PDwcDz55JP4+9//Xq/1FhQUoFWrVvjss8+M7lWqVCqoVCrdtFKpRGhoKAoLC+Hj41Ov7RER2brc3Fw0bdrUpoNQqVRCJpPV+XvcJi66/+9//4tz587hhx9+qPeyvr6+6NChAy5evGi0j5ubm03/TyciagyFQoE7d+5g9OjRAGqO13AENnGY9F//+hciIyMRERFR72WLi4tx6dIlBAcHm6EyIiLbVjVYZuzYsUhLSxO7HNGIGobFxcU4ceIETpw4AQDIysrCiRMn9Aa8KJVKbNiwAS+99JLBdQwZMgRLliz
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Decoding... done\n"
]
}
],
"source": [
"## Decode first parameter\n",
"decoding1 = cohomological_parameterization(data_4D_klein_bottle, coeff=23)\n",
"# show_feature(decoding1)\n",
"# plot_mean_against_index(data_4D_klein_bottle,decoding1)\n",
"# plot_mean_against_index(data,decoding1,\"phase\")\n",
"# plot_data(data,transformation=\"PCA\", labels=decoding1,\n",
"# colors=[\"Twilight\",\"Viridis\",\"Twilight\",\"Viridis\",\"Twilight\"])\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x251304908e0>"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGdCAYAAADAAnMpAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABF8ElEQVR4nO3df3RV5Zkv8O9JMAnUJAoMSYgRkGo1jSYCEiL4i4ZC60KZrplBqkKppSOFDjX9gekokfYOkdG6cCoFicOgwyi0vRWx2FgmCF5uk6GSptf4s0YQriZBoObEWIKTc+4fuSfkxzkn++yzn3e/797fz1qsVU53djbbffZ+9vs87/MGwuFwGEREREQuSXH7AIiIiMjfGIwQERGRqxiMEBERkasYjBAREZGrGIwQERGRqxiMEBERkasYjBAREZGrGIwQERGRq0a4fQBWhEIhfPDBB8jMzEQgEHD7cIiIiMiCcDiMzs5OjB8/Hikpscc/jAhGPvjgAxQUFLh9GERERGTD8ePHcdFFF8X8/40IRjIzMwH0/mOysrJcPhoiIiKyIhgMoqCgoO85HosRwUgkNZOVlcVghIiIyDDDlViwgJWIiIhcxWCEiIiIXMVghIiIiFzFYISIiIhcxWCEiIiIXMVghIiIiFzFYISIiIhcxWCEiIiIXJVwMPLyyy9j/vz5GD9+PAKBAHbt2jXsz+zfvx9TpkxBeno6PvvZz2Lbtm02DpWISE5PKIz6llN4rul91LecQk8o7PYhEflGwh1Yu7q6UFxc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enYDt5XwYjKdvCSDYhqm1sxa/0+LKppwKodTVhU04BZ6/clfeNk8yTSleS1aXrqlihROgb
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.scatter(param[:,1], decoding1['decoding'][:])"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAcEAAAGwCAYAAADRxd6MAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABawElEQVR4nO3dd3wUdf7H8demJwRCDUkg9N6CoCCcCkgQ8EITUZHTYL2f5U4PsXA2LCeWsx6ceHoKilIVVEROs1JEQIQQBEWlBEJJoaeQuru/P1YWluymkW3Z9/Px2IfZ73xn5pMY9p2Z+c58DRaLxYKIiIgfCvB0ASIiIp6iEBQREb+lEBQREb+lEBQREb+lEBQREb+lEBQREb+lEBQREb8V5OkCvJHZbObw4cPUr18fg8Hg6XJERKSaLBYLeXl5xMXFERDg/HhPIejA4cOHiY+P93QZIiJygQ4cOEDLli2dLlcIOlC/fn3A+sNr0KCBh6sREZGqWL16Nddddx3FxcUMHToUo9Fo+zx3RiHowJlToA0aNFAIioj4ELPZTFJSEu+++y7R0dGVXtJSCIqISJ0wevRoVq9eTd++fSkuLq7SOhodKiIiPmv16tXs3bvX9n7gwIGEhoZWeX2FoIiI+CSj0cjIkSMZPHgwBw4cqNE2FIIiIuJzjEYjSUlJFBUVkZCQQHR0dI22oxAUERGfcm4AJiUlsWTJkmqdAj2XQlBERHxGbQYgKARFRMRHrFu3rlYDEHSLhIiI+IguXbrQsWNHWrduXSsBCApBERHxEU2bNmXVqlVERkbWSgCCToeKiIgXMxqNvP3227b3TZo0qbUABB0JioiIlzp3EEyLFi24+uqra30fOhIUERGvc/4o0K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ERqaPOXANs06YNa9asITo62tMl1SqvGRjjTTSzvIiI7wyCcUQzy4uISI35cgBWh0JQRETs+EsAgkJQRETOsWbNGr8JQPCRWyRERMQ92rdvT4sWLejatWudD0BQCIqIyDlatmzJunXraNSoUZ0PQNDpUBERv2c0Glm8eLHtfUxMjF8EIOhIUETEr50ZBFNaWkp0dDSDBg3ydElupSNBERFvYLFAbiaUFrltl+eOAh05ciSXXnqp2/btLXQkKCLiaelrYfnf4NhuCG0AA/8Kgx6sve0f2wNlRfDTMsjcBs27YyzqTtKEm/xmFKgzCkERKS9rB6x9CXJ2QlxvGPQwNGnv6arqptPH4aMboLTA+r44F1Y9C43bQs9ra75dU6k1WNM+BIvZbpHxf1+QNL+QojKLXwcgKARF5Hwn9sN7I60fxgBHf4XdRrjne6jX1LO11UW/LD8bgOf6ceGFheA3z8DWD8o17zxiImn+aYrKIGlgd78OQNA1QRE5X+rcswF4xumjsG2BZ+qp6wzOPoYNVd/GtoXwem+Y3hDeHQGHt8KWOQ67dmkawK29g0nqFMSSKYP8OgBBR4Iicr68bMft+VnurcNfdPkjrJxW/g+P3lWc/m3PKlh659n3GRvg/bFQWuywu8FgYObVYZSaIaT9H2pWcx2iI0ERsddhqJP2RPfW4S/CG8GNi6B5j9/fN4arnoXu45yvU1YCh7ZA7mFIfb/88qKT0DDe9ta4t4xJn5ymxGSdNMhgMBDScQj0uIDTrXWEjgRFxF63sdA7xTqgAgADXHoXtBvswaLquNYD4K7voPAEhNSHwAo+mn/7H3x6DxQcsZ5KrR/ruN+xXWAIwLinxHYNMKFrSx66ezLEJkCHYRCg4yDNJ+iA5hMUwToyNGen9QNTI0O9Q+EJeKUblJ6uUnfj3rKzg2D8bBRoVT/HdSQoIo5Fd7W+xLNyfoGjv0GLPpCx0XE
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Decoding... done\n"
]
}
],
"source": [
"\n",
"## Decode second parameter\n",
"reduced_data = remove_feature(data_4D_klein_bottle, decoding1, cut_amplitude=0.5)\n",
"decoding2 = cohomological_parameterization(reduced_data, coeff=23)\n",
"# show_feature(decoding2)\n",
"# plot_mean_against_index(data,decoding2,\"orientation\")\n",
"# plot_mean_against_index(data,decoding2,\"phase\")\n",
"# plot_data(data,transformation=\"PCA\", labels=decoding2,\n",
"# colors=[\"Twilight\",\"Viridis\",\"Twilight\",\"Viridis\",\"Twilight\"])\n"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x25130ef1dc0>"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGdCAYAAADAAnMpAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA3H0lEQVR4nO3dfXyU1Z3///ckkASUBELMDRgholbTCJS7GBBdNQrqxvrr7pbaKpRarSx1qdluJa0SqS2x260/3Eqh0O3alnWha2tbCsalqWL9GppKSr+meLNCFFZzA0SSEAjBmfn+kSYkk8zkzGSuOTOZ1/PxyOOhw2euHCZhrvec61yf4/J6vV4BAABYkmB7AAAAIL4RRgAAgFWEEQAAYBVhBAAAWEUYAQAAVhFGAACAVYQRAABgFWEEAABYNcr2AEx4PB69//77GjdunFwul+3hAAAAA16vV+3t7Zo0aZISEvzPf8REGHn//feVm5trexgAACAER44c0YUXXuj3z2MijIwbN05S918mNTXV8mgAAICJtrY25ebm9p7H/YmJMNJzaSY1NZUwAgBAjBlqiQULWAEAgFWEEQAAYBVhBAAAWEUYAQAAVhFGAACAVYQRAABgFWEEAABYRRgBAABWBR1GXnrpJZWUlGjSpElyuVz6xS9+MeRzXnzxRc2aNUvJycm65JJL9NRTT4UwV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mx73hhhkL0wfG9Y6X5MNn2daN+B5E8xCgGndYN765i267Gu71DVID6CkRJfe+uYtIR33QMOJsNb5croZn5N9pZy+MzMaz4VxFUZaDbtvmtb5mmT
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.scatter(param[:,1], decoding2['decoding'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"\n",
"N = 10\n",
"radius = 10\n",
"theta_range = np.linspace(0, 2* np.pi, 20)\n",
"data_circle = [[radius*np.cos(theta), radius*np.sin(theta)] for theta in theta_range]"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"data_circle = pd.DataFrame(np.array(data_circle))"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbQAAAGwCAYAAADBpZBQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA3D0lEQVR4nO3de1xUdf4/8NdhgOE+igoDCiKKmKhgqGhpYLIJlqxGZa2rQ7bFmvbLzC72Tc1yw2prTbObbrrNGF7Ky8qafQ1Fts28gJf1a3lbTAzE1GQAFYQ5vz+MWYabMMzMOXPm9Xw85vFwznyYeXs483lxzrznHEEURRFEREROzk3qAoiIiGyBgUZERIrAQCMiIkVgoBERkSIw0IiISBEYaEREpAgMNCIiUgR3qQuwN5PJhJKSEvj7+0MQBKnLISKidhJFERUVFQgNDYWbW8v7YYoPtJKSEoSFhUldBhERdVBxcTF69OjR4uOKDzR/f38AN1dEQECAxNUQEVFbrFu3Dk888QQAYPLkyVizZo15Pm+J4gOt/jBjQEAAA42IyE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RkUzUN4CcOHECK1eulLocp8NAIyKSgcbdjPPnz5e6JKfDQCMikhhb822Da4yISEIMM9vhWiMikkhNTQ1ef/11hpmN8HtoREQS8fT0RG5uLlasWIGXX36ZYdZB/B4aEZGDnTlzBhEREVKX4TT4PTQiIhnS6/WIioqCwWCQuhTFYaARETmIXq+HTqdDbW0t9uzZI3U
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"persistence(data_circle, homdim=1, coeff=2)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbQAAAGwCAYAAADBpZBQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA3lElEQVR4nO3dfVhUdf4//udhgOF+FBAGFFQUMVHBUMHSxGQTLV2NylpXh2zLNe2Xmd3YJzXLT5htrWl2p5uuM4Y35c3Kmn0Mb9g28wa8Wb6Wd2FiICYmA6ggzPn9Ycwy3AnDzJwzZ56P65rrcs68mXl5OPN+cs685hxBFEURRERETs5N6gKIiIhsgYFGRESKwEAjIiJFYKAREZEiMNCIiEgRGGhERKQIDDQiIlIEd6kLsDeTyYSioiL4+/tDEASpyyEiojYSRRHl5eUIDw+Hm1vz+2GKD7SioiJERERIXQYREbVTYWEhunTp0uzjig80f39/ALdWREBAgMTVEBFRa2zYsAFPPfUUAGDSpElYt26deT5vjuIDre4wY0BAAAONiMhJ1NTUAACmTZuGxYsXY926dbf92EjxgUZERM5n+vTp6NOnD4YNG4aKiopW/Qy7HImISBa2bduGy5cvm+8PHz68xSaQhhhoREQkOYPBgAkTJiAlJQVGo9Gq52CgERGRpAwGA6ZMmQJRFJGUlAQ/Pz+rnoeBRkREkqkfZtOmTcMHH3zQpsOM9THQiIhIErYMM4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V1OU6
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Decoding... done\n"
]
}
],
"source": [
"decoding1 = cohomological_parameterization(data_circle, coeff=25)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x1a8b5522850>"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGdCAYAAADAAnMpAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAqrUlEQVR4nO3df3Rb9X3/8Zckaouz2Zc4qS0lGOKlUNBMnDiJXPNjPW2dxhyOVnbOthxWk5yU9hx8QhrwekbSQVSvW0x3li7bkjpLWtae48OSjjNYXVKxzAU6Ts00ovkcNFNaijnJAclOvh6yceekk+73jxybCFuO5dj66Mfzcc49B330ufbb4lC9ej/3874O27ZtAQAAGOI0XQAAAChthBEAAGAUYQQAABhFGAEAAEYRRgAAgFGEEQAAYBRhBAAAGEUYAQAARl1juoD5SKVSevfdd1VRUSGHw2G6HAAAMA+2bWt8fFwrV66U05n5+kdBhJF3331XtbW1pssAAAALcPbsWV1//fUZ3y+IMFJRUSHp0h9TWVlpuBoAADAfY2Njqq2tnf4ez6QgwsjU0kxlZSVhBACAAnOlWyy4gRUAABhFGAEAAEZlHUZ+8pOfKBAIaOXKlXI4HHr22WeveM6LL76oxsZGlZeX62Mf+5i++93vLqBUAABQjLIOIxMTE2poaNDhw4fnNX9oaEj33HOPPvWpT2lgYEAPP/ywvvjFL+r555/PulgAAFB8sr6B9e6779bdd9897/lHjhxRXV2dDhw4IEm69dZb9fLLL+uv//qvtWXLlmx/PQAAKDJLf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
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.scatter(theta_range, decoding1['decoding'])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Source manifold: coordinates to natural embedding\n",
"obser"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"source_manifold\n",
"open_cover\n",
"patch\n",
"set of patches\n",
"coordinate system for each patch\n",
"observed_embedding\n",
"homologies give us better candidates for meaningful coordinates"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def circle(theta):\n",
" \n",
"def torus(theta, phi):\n",
"\n",
"def klein_bottle(theta, phi):\n",
"\n",
"def sphere(theta, phi):\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# -*- coding: utf-8 -*-\n",
" \n",
"def hausdorff(data1, data2, homdim, coeff):\n",
" \"\"\"Hausdorff metric between two persistence diagrams\"\"\"\n",
" dgm1 = (ripser.ripser(data1,maxdim=homdim,coeff=coeff))['dgms']\n",
" dgm2 = (ripser.ripser(data2,maxdim=homdim,coeff=coeff))['dgms']\n",
" distance = directed_hausdorff(dgm1[homdim], dgm2[homdim])[0]\n",
" return distance\n",
"\n",
"@multi_input\n",
"def confidence(X, alpha=0.05, Nsubsamples=20, homdim=1, coeff=2):\n",
" \"\"\"\n",
" Compute the confidence interval of the persistence diagram of a dataset\n",
" \n",
" Computation done by subsampling as in arxiv:1303.7117\n",
" \n",
" Parameters\n",
" ----------\n",
" X: dataframe(n_datapoints, n_features):\n",
" Dataframe containing the data\n",
" alpha : float between 0 and 1, optional, default 0.05\n",
" 1-alpha is the confidence\n",
" Nsubsamples : int, optional, default 20\n",
" The number of subsamples\n",
" homdim : int, optional, default 1\n",
" The dimension of the homology\n",
" coeff : int prime, optional, default 2\n",
" The coefficient basis\n",
" \"\"\"\n",
" N = X.shape[0]\n",
" distances = np.zeros(Nsubsamples)\n",
" iterator = trange(0, Nsubsamples, position=0, leave=True)\n",
" iterator.set_description(\"Computing confidence interval\")\n",
" for i in iterator:\n",
" subsample = X.iloc[np.random.choice(N, N, replace=True)] # replace = False\n",
" distances[i] = hausdorff(X, subsample, homdim, coeff)\n",
" distances.sort()\n",
" confidence = np.sqrt(2) * 2 * distances[int(alpha*Nsubsamples)]\n",
" return confidence\n",
"\n",
"@multi_input\n",
"def persistence(X, homdim=1, coeff=2, threshold=float('inf'),\n",
" show_largest_homology=0, distance_matrix=False, Nsubsamples=0,\n",
" alpha=0.05, cycle=None, save_path=None):\n",
" \"\"\"\n",
" Plot the persistence diagram of a dataset using ripser\n",
"\n",
" Also prints the five largest homology components\n",
" \n",
" Parameters\n",
" ----------\n",
" X: dataframe(n_datapoints, n_features):\n",
" Dataframe containing the data\n",
" homdim : int, optional, default 1\n",
" The dimension of the homology\n",
" coeff : int prime, optional, default 2\n",
" The coefficient basis\n",
" threshold : float, optional, default infinity\n",
" The maximum distance in the filtration\n",
" show_largest_homology: int, optional, default 0\n",
" Print this many of the largest homology components\n",
" distance_matrix : bool, optional, default False\n",
" When true X will be interepreted as a distance matrix\n",
" Nsubsamples : int, optional, default 0\n",
" The number of subsamples used in computing the confidence interval\n",
" Does not compute the confidence interval when this is 0\n",
" alpha : float between 0 and 1, optional, default 0.05\n",
" 1-alpha is the confidence\n",
" cycle : int, optional, default None\n",
" If given highlight the homology component in the plot corresponding to\n",
" this cycle id\n",
" save_path : str, optional, default None\n",
" When given save the plot here\n",
" \"\"\"\n",
" result = ripser.ripser(X, maxdim=homdim, coeff=coeff, do_cocycles=True,\n",
" distance_matrix=distance_matrix, thresh=threshold)\n",
" diagrams = result['dgms']\n",
" plot_diagrams(diagrams, show=False)\n",
" if (Nsubsamples>0):\n",
" conf = confidence(X, alpha, Nsubsamples, homdim, 2)\n",
" line_length = 10000\n",
" plt.plot([0, line_length], [conf, line_length + conf], color='green',\n",
" linestyle='dashed',linewidth=2)\n",
" if cycle is not None:\n",
" dgm1 = diagrams[1]\n",
" plt.scatter(dgm1[cycle, 0], dgm1[cycle, 1], 20, 'k', 'x')\n",
" if save_path is not None:\n",
" path = save_path + 'Z' + str(coeff)\n",
" if (Nsubsamples>0):\n",
" path += '_confidence' + str(1-alpha)\n",
" path += '.png'\n",
" plt.savefig(path)\n",
" plt.show()\n",
" \n",
" if show_largest_homology != 0:\n",
" dgm = diagrams[homdim]\n",
" largest_indices = np.argsort(dgm[:, 0] - dgm[:, 1])\n",
" largest_components = dgm[largest_indices[:show_largest_homology]]\n",
" print(f\"Largest {homdim}-homology components:\")\n",
" print(largest_components)\n",
" return\n",
"\n",
"@multi_input\n",
"def persistence_witness(X, number_of_landmarks=100, max_alpha_square=0.0,\n",
" homdim=1):\n",
" \"\"\"\n",
" Plot the persistence diagram of a dataset using gudhi\n",
"\n",
" Uses a witness complex allowing it to be used on larger datasets\n",
" \n",
" Parameters\n",
" ----------\n",
" X: dataframe(n_datapoints, n_features):\n",
" Dataframe containing the data\n",
" number_of_landmarks : int, optional, default 100\n",
" The number of landmarks in the witness complex\n",
" max_alpha_square : double, optional, default 0.0\n",
" Maximal squared relaxation parameter\n",
" homdim : int, optional, default 1\n",
" The dimension of the homology\n",
" \"\"\"\n",
" print(\"Sampling landmarks...\", end=\" \")\n",
" \n",
" witnesses = X.to_numpy()\n",
" landmarks = gudhi.pick_n_random_points(\n",
" points=witnesses, nb_points=number_of_landmarks\n",
" )\n",
" print(\"done\")\n",
" message = (\n",
" \"EuclideanStrongWitnessComplex with max_edge_length=\"\n",
" + repr(max_alpha_square)\n",
" + \" - Number of landmarks=\"\n",
" + repr(number_of_landmarks)\n",
" )\n",
" print(message)\n",
" witness_complex = gudhi.EuclideanStrongWitnessComplex(\n",
" witnesses=witnesses, landmarks=landmarks\n",
" )\n",
" simplex_tree = witness_complex.create_simplex_tree(\n",
" max_alpha_square=max_alpha_square,\n",
" limit_dimension=homdim\n",
" )\n",
" message = \"Number of simplices=\" + repr(simplex_tree.num_simplices())\n",
" print(message)\n",
" diag = simplex_tree.persistence()\n",
" print(\"betti_numbers()=\")\n",
" print(simplex_tree.betti_numbers())\n",
" gudhi.plot_persistence_diagram(diag, band=0.0)\n",
" plt.show()\n",
" return\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"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"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}