diff options
Diffstat (limited to 'evaluation/adept_ablation/lambda/evaluation_loci_looped_abl2.ipynb')
-rw-r--r-- | evaluation/adept_ablation/lambda/evaluation_loci_looped_abl2.ipynb | 469 |
1 files changed, 469 insertions, 0 deletions
diff --git a/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl2.ipynb b/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl2.ipynb new file mode 100644 index 0000000..5b8e275 --- /dev/null +++ b/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl2.ipynb @@ -0,0 +1,469 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import seaborn as sns\n", + "import warnings\n", + "import scipy.stats as stats\n", + "import os\n", + "\n", + "warnings.simplefilter(action='ignore', category=FutureWarning)\n", + "pd.options.mode.chained_assignment = None \n", + "plt.style.use('ggplot')\n", + "sns.color_palette(\"Paired\");\n", + "sns.set_theme();" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Data Loading" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# setting path to results folder\n", + "root_path = '../../../out/pretrained/adept_ablations/lambda'\n", + "\n", + "# list all folders in root path that don't stat with a dot\n", + "nets = ['adept_level1_ablation_lambda.run411']\n", + "\n", + "# read pickle file\n", + "tf = pd.DataFrame()\n", + "sf = pd.DataFrame()\n", + "af = pd.DataFrame()\n", + "\n", + "# load statistics files from nets\n", + "for net in nets:\n", + " path = os.path.join(root_path, net, 'results')\n", + " with open(os.path.join(path, 'trialframe.csv'), 'rb') as f:\n", + " tf_temp = pd.read_csv(f, index_col=0)\n", + " tf_temp['net'] = net\n", + " tf = pd.concat([tf,tf_temp])\n", + "\n", + " with open(os.path.join(path, 'slotframe.csv'), 'rb') as f:\n", + " sf_temp = pd.read_csv(f, index_col=0)\n", + " sf_temp['net'] = net\n", + " sf = pd.concat([sf,sf_temp])\n", + "\n", + " with open(os.path.join(path, 'accframe.csv'), 'rb') as f:\n", + " af_temp = pd.read_csv(f, index_col=0)\n", + " af_temp['net'] = net\n", + " af = pd.concat([af,af_temp])\n", + "\n", + "# cast variables\n", + "sf['visible'] = sf['visible'].astype(bool)\n", + "sf['bound'] = sf['bound'].astype(bool)\n", + "sf['occluder'] = sf['occluder'].astype(bool)\n", + "sf['inimage'] = sf['inimage'].astype(bool)\n", + "sf['vanishing'] = sf['vanishing'].astype(bool)\n", + "sf['alpha_pos'] = 1-sf['alpha_pos']\n", + "sf['alpha_ges'] = 1-sf['alpha_ges']\n", + "\n", + "# scale to percentage\n", + "sf['TE'] = sf['TE'] * 100\n", + "\n", + "# add surprise as dummy code\n", + "tf['control'] = [('control' in set) for set in tf['set']]\n", + "sf['control'] = [('control' in set) for set in sf['set']]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Calculate Tracking Error (TE)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Tracking Error when visible: M: 5.25 , STD: 7.52, Count: 1246\n", + "Tracking Error when occluded: M: 5.16 , STD: 4.93, Count: 342\n" + ] + } + ], + "source": [ + "grouping = (sf.inimage & sf.bound & ~sf.occluder & sf.control)\n", + "\n", + "def get_stats(col):\n", + " return f' M: {col.mean():.3} , STD: {col.std():.3}, Count: {col.count()}'\n", + "\n", + "# When Visible\n", + "temp = sf[grouping & sf.visible]\n", + "print(f'Tracking Error when visible:' + get_stats(temp['TE']))\n", + "\n", + "# When Occluded\n", + "temp = sf[grouping & ~sf.visible]\n", + "print(f'Tracking Error when occluded:' + get_stats(temp['TE']))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Calculate Succesfull Trackings (TE)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "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>set</th>\n", + " <th>evalmode</th>\n", + " <th>tracked_pos</th>\n", + " <th>tracked_neg</th>\n", + " <th>tracked_pos_pro</th>\n", + " <th>tracked_neg_pro</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>control</td>\n", + " <td>open</td>\n", + " <td>18</td>\n", + " <td>15</td>\n", + " <td>0.545455</td>\n", + " <td>0.454545</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " set evalmode tracked_pos tracked_neg tracked_pos_pro \\\n", + "0 control open 18 15 0.545455 \n", + "\n", + " tracked_neg_pro \n", + "0 0.454545 " + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# succesfull trackings: In the last visible moment of the target, the slot was less than 10% away from the target\n", + "# determine last visible frame numeric\n", + "grouping_factors = ['net','set','evalmode','scene','slot']\n", + "ff = sf[sf.visible & sf.bound & sf.inimage].groupby(grouping_factors).max()\n", + "ff.rename(columns = {'frame':'last_visible'}, inplace = True)\n", + "sf = sf.merge(ff[['last_visible']], on=grouping_factors, how='left')\n", + "\n", + "# same for first bound frame\n", + "ff = sf[sf.visible & sf.bound & sf.inimage].groupby(grouping_factors).min()\n", + "ff.rename(columns = {'frame':'first_visible'}, inplace = True)\n", + "sf = sf.merge(ff[['first_visible']], on=grouping_factors, how='left')\n", + "\n", + "# add dummy variable to sf\n", + "sf['last_visible'] = (sf['last_visible'] == sf['frame'])\n", + "\n", + "# extract the trials where the target was last visible and threshold the TE\n", + "ff = sf[sf['last_visible']] \n", + "ff['tracked_pos'] = (ff['TE'] < 10)\n", + "ff['tracked_neg'] = (ff['TE'] >= 10)\n", + "\n", + "# fill NaN with 0\n", + "sf = sf.merge(ff[grouping_factors + ['tracked_pos', 'tracked_neg']], on=grouping_factors, how='left')\n", + "sf['tracked_pos'].fillna(False, inplace=True)\n", + "sf['tracked_neg'].fillna(False, inplace=True)\n", + "\n", + "# Aggreagte over all scenes\n", + "temp = sf[(sf['frame']== 1) & ~sf.occluder & sf.control & (sf.first_visible < 20)]\n", + "temp = temp.groupby(['set', 'evalmode']).sum()\n", + "temp = temp[['tracked_pos', 'tracked_neg']]\n", + "temp = temp.reset_index()\n", + "\n", + "temp['tracked_pos_pro'] = temp['tracked_pos'] / (temp['tracked_pos'] + temp['tracked_neg'])\n", + "temp['tracked_neg_pro'] = temp['tracked_neg'] / (temp['tracked_pos'] + temp['tracked_neg'])\n", + "\n", + "temp" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Mostly Tracked stats" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEmCAYAAAB20LuSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAmP0lEQVR4nO3deUCUdeLH8fcAgmIqiDPgbeVNoB0mkWm6rtfPKzXzpFYjj1WSWlfNM4+FSvPIsqTMLK3MvNg1JM9KTdNNzfK28oZR1ERBYGZ+f1izy3oAOjjMw+f1F888zzzzAcaPX57nme9jcjgcDkRExDC83B1ARERcS8UuImIwKnYREYNRsYuIGIyKXUTEYFTsIiIGo2IXETEYH3cHADh37hJ2uy6nd4WgoLs4ezbd3TFErqH3put4eZkIDCx9w/VFotjtdoeK3YX0s5SiSu/NO0OHYkREDEbFLiJiMEXi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EpFFOmTKF27dokJydTsmRJli9fzsyZM90dq1hQsYtIobDb7TRp0oT169fTqlUrKlasiM1mc3esYkHFLiKFolSpUsybN4+tW7fSvHlzFixYQOnSpd0dq1hQsYtIoZg6dSqXL19m1qxZlCtXjpSUFKZNm+buWMWCrooRETEYjdhFRAxGxS4iYjAqdpECOHbsWK45UESKIhW7SAGcPHmSn3/+2d0xRG5KJ0+lWLt06RKjRo3i119/xcvLi9DQUCZOnMiGDRuYM2cO2dnZlCxZkhEjRhAeHk6bNm1ISUmhUaNGvPfee+6OL3JdGrFLsfbll19y6dIlVqxY4bwB+NGjR5k+fTpz585l+fLlTJo0iaFDh3LlyhUmT55MtWrVVOpSpGl2RynWHnzwQaZPn07fvn2JjIzk6aefZtOmTaSmpvLMM884tzOZTJrrRDyGil2KtapVq/Lll1+ydetWvv32W/7yl78wYMAAHnnkEWbMmOHc7tSpU1gsFrZv3+6+sCL5pEMxUqwtWrSIUaNG0aRJE4YPH06TJk24cOECmzZt4vDhwwBs3LiRjh07kpmZibe3N9nZ2W5OLXJzGrFLsda5c2e2bdtGu3btKFWqFBUrVqRv377ce++9vPDCCzgcDnx8fJgzZw6lS5emZs2a+Pn50a1bNz777LPr3tNTxN10VYyIiMHoUIyIiMGo2EVEDEbFLiJiMCp2ERGDUbGLiBiMil1ExGBU7CIiBqNiFxExmP8HXuChHBTEVwUAAAAASUVORK5CYII=", + "text/plain": [ + "<Figure size 432x288 with 1 Axes>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "temp = af[af.index == 'OVERALL']\n", + "temp['mostly_tracked'] = temp['mostly_tracked'] / temp['num_unique_objects']\n", + "temp['partially_tracked'] = temp['partially_tracked'] / temp['num_unique_objects']\n", + "temp['mostly_lost'] = temp['mostly_lost'] / temp['num_unique_objects']\n", + "g = temp[['mostly_tracked', 'partially_tracked', 'mostly_lost','set']].set_index(['set']).groupby(['set']).mean().plot(kind='bar', stacked=True);" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# MOTA " + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "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>idf1</th>\n", + " <th>idp</th>\n", + " <th>idr</th>\n", + " <th>recall</th>\n", + " <th>precision</th>\n", + " <th>num_unique_objects</th>\n", + " <th>mostly_tracked</th>\n", + " <th>partially_tracked</th>\n", + " <th>mostly_lost</th>\n", + " <th>num_false_positives</th>\n", + " <th>num_misses</th>\n", + " <th>num_switches</th>\n", + " <th>num_fragmentations</th>\n", + " <th>mota</th>\n", + " <th>motp</th>\n", + " <th>num_transfer</th>\n", + " <th>num_ascend</th>\n", + " <th>num_migrate</th>\n", + " </tr>\n", + " <tr>\n", + " <th>set</th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>control</th>\n", + " <td>0.753959</td>\n", + " <td>0.934199</td>\n", + " <td>0.632020</td>\n", + " <td>0.639984</td>\n", + " <td>0.945970</td>\n", + " <td>86.0</td>\n", + " <td>43.0</td>\n", + " <td>5.0</td>\n", + " <td>38.0</td>\n", + " <td>179.0</td>\n", + " <td>1763.0</td>\n", + " <td>7.0</td>\n", + " <td>22.0</td>\n", + " <td>0.602001</td>\n", + " <td>0.059856</td>\n", + " <td>0.0</td>\n", + " <td>7.0</td>\n", + " <td>0.0</td>\n", + " </tr>\n", + " <tr>\n", + " <th>surprise</th>\n", + " <td>0.751982</td>\n", + " <td>0.930841</td>\n", + " <td>0.630779</td>\n", + " <td>0.644079</td>\n", + " <td>0.950467</td>\n", + " <td>33.0</td>\n", + " <td>13.0</td>\n", + " <td>6.0</td>\n", + " <td>14.0</td>\n", + " <td>53.0</td>\n", + " <td>562.0</td>\n", + " <td>3.0</td>\n", + " <td>11.0</td>\n", + " <td>0.608613</td>\n", + " <td>0.058177</td>\n", + " <td>0.0</td>\n", + " <td>3.0</td>\n", + " <td>0.0</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " idf1 idp idr recall precision \\\n", + "set \n", + "control 0.753959 0.934199 0.632020 0.639984 0.945970 \n", + "surprise 0.751982 0.930841 0.630779 0.644079 0.950467 \n", + "\n", + " num_unique_objects mostly_tracked partially_tracked mostly_lost \\\n", + "set \n", + "control 86.0 43.0 5.0 38.0 \n", + "surprise 33.0 13.0 6.0 14.0 \n", + "\n", + " num_false_positives num_misses num_switches num_fragmentations \\\n", + "set \n", + "control 179.0 1763.0 7.0 22.0 \n", + "surprise 53.0 562.0 3.0 11.0 \n", + "\n", + " mota motp num_transfer num_ascend num_migrate \n", + "set \n", + "control 0.602001 0.059856 0.0 7.0 0.0 \n", + "surprise 0.608613 0.058177 0.0 3.0 0.0 " + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "af[af.index == 'OVERALL'].groupby(['set']).mean()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Gate Openings" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Percept gate openings when visible: M: 0.061 , STD: 0.108, Count: 1246\n", + "Percept gate openings when occluded: M: 0.00026 , STD: 0.00481, Count: 342\n" + ] + } + ], + "source": [ + "grouping = (sf.inimage & sf.bound & ~sf.occluder & sf.control)\n", + "temp = sf[grouping & sf.visible]\n", + "print(f'Percept gate openings when visible:' + get_stats(temp['alpha_pos'] + temp['alpha_ges']))\n", + "temp = sf[grouping & ~sf.visible]\n", + "print(f'Percept gate openings when occluded:' + get_stats(temp['alpha_pos'] + temp['alpha_ges']))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "loci23", + "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.9.16" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} |