From 6097a111f0a709638f5a0590da43feb0894ed683 Mon Sep 17 00:00:00 2001 From: Andi Gerken <andi.gerken@gmail.com> Date: Tue, 12 Oct 2021 18:05:52 +0200 Subject: [PATCH] Removed old file --- automation/_create_dset.ipynb | 128 ---------------------------------- 1 file changed, 128 deletions(-) delete mode 100644 automation/_create_dset.ipynb diff --git a/automation/_create_dset.ipynb b/automation/_create_dset.ipynb deleted file mode 100644 index 6bbaf72..0000000 --- a/automation/_create_dset.ipynb +++ /dev/null @@ -1,128 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "source": [ - "%reload_ext autoreload\n", - "%autoreload 2\n", - "\n", - "import fish_models\n", - "import numpy as np\n", - "import copy\n", - "from pathlib import Path\n", - "import json\n", - "\n", - "requested_dset = \"lfftr_aav_4_2piw_10_2pif_rd2_mf10_oris\"\n", - "\n", - "dataset_json = json.load(open(\"../buffer/datasets.json\", \"r\"))\n", - "meta_config = dataset_json[requested_dset]\n", - "\n", - "config = meta_config[\"dataset_config\"]" - ], - "outputs": [], - "metadata": {} - }, - { - "cell_type": "code", - "execution_count": 3, - "source": [ - "modified_config = copy.deepcopy(config)\n", - "\n", - "if config[\"data_path\"] == \"live_female_female/train\":\n", - " modified_config[\"data_path\"] = fish_models.live_female_female_data() / \"train\"\n", - "else:\n", - " raise Exception(\"Not supported data\")\n", - "\n", - "translate = {\n", - " \"pi\":np.pi,\n", - " \"2pi\":2 * np.pi\n", - "}\n", - "for k, v in modified_config[\"raycast\"].items():\n", - " if type(v) is not list and v in translate:\n", - " modified_config[\"raycast\"][k] = translate[v]\n", - "\n", - "if \"speed_bins\" in modified_config:\n", - " sb = modified_config[\"speed_bins\"]\n", - " modified_config[\"speed_bin_borders\"] = np.linspace(sb[0], sb[1], sb[2])\n", - " modified_config.pop(\"speed_bins\")\n", - "if \"turn_bins\" in modified_config:\n", - " sb = modified_config[\"turn_bins\"]\n", - " modified_config[\"turn_bin_borders\"] = np.linspace(sb[0], sb[1], sb[2])\n", - " modified_config.pop(\"turn_bins\")\n", - "\n", - "raycast = fish_models.gym_interface.Raycast(world_bounds=([-50, -50], [50, 50]),**modified_config[\"raycast\"])\n", - "\n", - "modified_config[\"raycast\"] = raycast\n", - "dset = fish_models.datasets.io_dataset.IoDataset(**modified_config)\n", - "\n", - "storage_path = Path(\"../buffer\") / meta_config[\"path\"]\n", - "if storage_path.exists():\n", - " raise Exception(f\"File exists and will be overwritten.\")\n", - "dset.store(storage_path)" - ], - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Loading data from 20 files.\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 20/20 [00:23<00:00, 1.17s/it]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Calculating views from 20 files.\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 20%|██ | 4/20 [00:11<00:48, 3.01s/it]" - ] - } - ], - "metadata": {} - }, - { - "cell_type": "code", - "execution_count": null, - "source": [], - "outputs": [], - "metadata": {} - } - ], - "metadata": { - "orig_nbformat": 4, - "language_info": { - "name": "python", - "version": "3.8.10", - "mimetype": "text/x-python", - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "pygments_lexer": "ipython3", - "nbconvert_exporter": "python", - "file_extension": ".py" - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3.8.10 64-bit" - }, - "interpreter": { - "hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file -- GitLab