aboutsummaryrefslogtreecommitdiff
path: root/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl3.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'evaluation/adept_ablation/lambda/evaluation_loci_looped_abl3.ipynb')
-rw-r--r--evaluation/adept_ablation/lambda/evaluation_loci_looped_abl3.ipynb469
1 files changed, 469 insertions, 0 deletions
diff --git a/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl3.ipynb b/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl3.ipynb
new file mode 100644
index 0000000..f137a5f
--- /dev/null
+++ b/evaluation/adept_ablation/lambda/evaluation_loci_looped_abl3.ipynb
@@ -0,0 +1,469 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "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": 11,
+ "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.run511']\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": 12,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Tracking Error when visible: M: 3.34 , STD: 4.22, Count: 1873\n",
+ "Tracking Error when occluded: M: 2.78 , STD: 1.66, Count: 492\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": 13,
+ "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>37</td>\n",
+ " <td>11</td>\n",
+ " <td>0.770833</td>\n",
+ " <td>0.229167</td>\n",
+ " </tr>\n",
+ " </tbody>\n",
+ "</table>\n",
+ "</div>"
+ ],
+ "text/plain": [
+ " set evalmode tracked_pos tracked_neg tracked_pos_pro \\\n",
+ "0 control open 37 11 0.770833 \n",
+ "\n",
+ " tracked_neg_pro \n",
+ "0 0.229167 "
+ ]
+ },
+ "execution_count": 13,
+ "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": 14,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEmCAYAAAB20LuSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAmL0lEQVR4nO3deUBU5eLG8e8AgksqiDPgbuZOoC0mkWma1+2nZmrmXlfD7SpJXa8abrkEleaSZUmZWVqZO10Dcq3UNL0pWe5W7jCKmigozMzvD29TXBdABwcOz+cvzpwzZx5heHw5c857TA6Hw4GIiBiGh7sDiIiIa6nYRUQMRsUuImIwKnYREYNRsYuIGIyKXUTEYFTsIiIG4+XuAABnz17Ebtfp9K7g738XZ86kuTuGyDX03nQdDw8Tfn6lbri+QBS73e5QsbuQvpdSUOm9eWfoUIyIiMGo2EVEDKZAHIoRkVtns2Vx9qyVrKwr7o5yUykpHtjtdnfHKFS8vLzx8zPj6Zm3qlaxixRyZ89aKV68JKVKBWIymdwd54a8vDzIylKx55bD4eDixd85e9ZK+fIV8vTcXB2KSUtLo3379hw7duyadXv27KFz5860bt2aqKgosrKy8hRARG5PVtYVSpUqU6BLXfLOZDJRqlSZW/pLLMdi37VrFz169ODXX3+97voRI0Ywbtw4EhIScDgcLF68OM8hROT2qNSN6VZ/rjkW++LFixk/fjwWi+WadcePHycjI4OGDRsC0LlzZ+Lj428piIiIuEaOx9inTJlyw3UpKSmYzWbnstlsJjk5Oc8h/P3vyvNz7rQrtky8PYu5O0aumM2l3R0hR4Xp+1nQJaeY8PLKPkYrUdKH4j6u/wgt43IW6Zcu3/Lz/zdnbvz0027Wr1/L0KHP88UXq/jPf3YwbtzLedpHWtoFJk2awKuvTstxW4fDcdOR8uDB4Tz33EAeeODBPGUAiI19B4Dw8EG5fo6Hh0eef6dv6ydvt9uzfQNy+obcyJkzaQX+wgWz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7du0oUaIEFSpUoE+fPtxzzz288MILOBwOvLy8mDNnDqVKlaJmzZr4+PjQtWtXPv/88+ve01PE3XRWjIiIwehQjIiIwajYRUQMRsUuImIwKnYREYNRsYuIGIyKXUTEYFTsIiIGo2IXETGY/wd9OaIYPoF6DAAAAABJRU5ErkJggg==",
+ "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": 15,
+ "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.773828</td>\n",
+ " <td>0.943857</td>\n",
+ " <td>0.655708</td>\n",
+ " <td>0.673474</td>\n",
+ " <td>0.969430</td>\n",
+ " <td>86.0</td>\n",
+ " <td>41.0</td>\n",
+ " <td>15.0</td>\n",
+ " <td>30.0</td>\n",
+ " <td>104.0</td>\n",
+ " <td>1599.0</td>\n",
+ " <td>9.0</td>\n",
+ " <td>31.0</td>\n",
+ " <td>0.650398</td>\n",
+ " <td>0.039370</td>\n",
+ " <td>0.0</td>\n",
+ " <td>9.0</td>\n",
+ " <td>0.0</td>\n",
+ " </tr>\n",
+ " <tr>\n",
+ " <th>surprise</th>\n",
+ " <td>0.776620</td>\n",
+ " <td>0.942186</td>\n",
+ " <td>0.660545</td>\n",
+ " <td>0.678911</td>\n",
+ " <td>0.968383</td>\n",
+ " <td>33.0</td>\n",
+ " <td>16.0</td>\n",
+ " <td>4.0</td>\n",
+ " <td>13.0</td>\n",
+ " <td>35.0</td>\n",
+ " <td>507.0</td>\n",
+ " <td>4.0</td>\n",
+ " <td>12.0</td>\n",
+ " <td>0.654212</td>\n",
+ " <td>0.039468</td>\n",
+ " <td>2.0</td>\n",
+ " <td>2.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.773828 0.943857 0.655708 0.673474 0.969430 \n",
+ "surprise 0.776620 0.942186 0.660545 0.678911 0.968383 \n",
+ "\n",
+ " num_unique_objects mostly_tracked partially_tracked mostly_lost \\\n",
+ "set \n",
+ "control 86.0 41.0 15.0 30.0 \n",
+ "surprise 33.0 16.0 4.0 13.0 \n",
+ "\n",
+ " num_false_positives num_misses num_switches num_fragmentations \\\n",
+ "set \n",
+ "control 104.0 1599.0 9.0 31.0 \n",
+ "surprise 35.0 507.0 4.0 12.0 \n",
+ "\n",
+ " mota motp num_transfer num_ascend num_migrate \n",
+ "set \n",
+ "control 0.650398 0.039370 0.0 9.0 0.0 \n",
+ "surprise 0.654212 0.039468 2.0 2.0 0.0 "
+ ]
+ },
+ "execution_count": 15,
+ "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": 16,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percept gate openings when visible: M: 0.132 , STD: 0.145, Count: 1873\n",
+ "Percept gate openings when occluded: M: 0.00809 , STD: 0.0444, Count: 492\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
+}