Skip to content

Commit

Permalink
Removed Sensorium 2022 dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
neuronmorph authored Mar 11, 2024
1 parent 0a277d9 commit 9fc9114
Showing 1 changed file with 1 addition and 131 deletions.
132 changes: 1 addition & 131 deletions notebooks/2dcores_starter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -110,137 +110,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Before learning how to use the cores, let's load the data. \n",
"\n",
"DISCLAIMER! Here we are importing data used in **Sensorium 2022** competition (https://github.com/sinzlab/sensorium). \n",
"\n",
"In case you do not have **sensorium package** installed, feel free to skip to section\n",
"[Simulated batch of images](#another_cell)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"### Imports"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# install sensorium from the repo\n",
"!pip install git+https://github.com/sinzlab/sensorium.git"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"import warnings\n",
"warnings.filterwarnings('ignore')\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import torch\n",
"from nnfabrik.builder import get_data\n",
"\n",
"device = \"cpu\"\n",
"random_seed = 42\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"### Instantiate DataLoader"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"# loading the SENSORIUM+ dataset\n",
"filenames = ['/project/data/static22846-10-16-GrayImageNet-94c6ff995dac583098847cfecd43e7b6.zip', ]\n",
"\n",
"dataset_fn = 'sensorium.datasets.static_loaders'\n",
"dataset_config = {'paths': filenames,\n",
" 'normalize': True,\n",
" 'include_behavior': False,\n",
" 'include_eye_position': True,\n",
" 'batch_size': 32,\n",
" 'scale':1,\n",
" 'cuda': False\n",
" }\n",
"\n",
"dataloaders = get_data(dataset_fn, dataset_config)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"### Access the input images in a batch of train data"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"dl = dataloaders['train']['22846-10-16']"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"batch = next(iter(dl))\n",
"images = batch.images"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"torch.Size([32, 1, 144, 256])"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"images.shape"
"Before learning how to use the cores, let's create a dummy data **images**. This data will be similar to a batch of images."
]
},
{
Expand Down

0 comments on commit 9fc9114

Please sign in to comment.