-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from juglab/dev
Dev
- Loading branch information
Showing
15 changed files
with
776 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
132 changes: 132 additions & 0 deletions
132
examples/datamodules/DataModule - MNIST Tomo Baseline.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from fit.datamodules.baselines import MNISTBaselineDataModule\n", | ||
"\n", | ||
"from matplotlib import pyplot as plt\n", | ||
"\n", | ||
"import torch\n", | ||
"\n", | ||
"import numpy as np\n", | ||
"\n", | ||
"from skimage.transform import iradon\n", | ||
"\n", | ||
"from fit.utils.utils import denormalize" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# MNIST Tomo Fourier Target\n", | ||
"Create a MNIST projection dataset with 15 angles and batch-size 4." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 51, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"batch_size = 4\n", | ||
"num_angles = 7\n", | ||
"img_shape = 27\n", | ||
"inner_circle = True" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 52, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"dm = MNISTBaselineDataModule(root_dir='/home/tibuch/Data/mnist/', batch_size=batch_size, \n", | ||
" num_angles=num_angles, inner_circle=inner_circle)\n", | ||
"dm.setup()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 53, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"mean, std = dm.mean, dm.std" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 54, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"train_dl = dm.train_dataloader()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 55, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"for rec, img in train_dl:\n", | ||
" break" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 59, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlAAAAEtCAYAAADHtl7HAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAga0lEQVR4nO3deZClZZXn8d+5N2/uWUvWRhUUYJWAgAhiiYhKg7RLM2MDHROEzIyDdrdohI4aGqOOY3Q7S0/Y2irdxmgPNgzoKD094NY9KAJNNxJuFCVCQcliyVJZG0UtuW83n/kjL2FKZNY5T+Zdi+8noqIyb5583lNv3vvUyffe/KWllAQAAIC4QqMbAAAAaDUMUAAAAJkYoAAAADIxQAEAAGRigAIAAMjEAAUAAJCJAQoAACATAxSWxMyeNLMxMxue8+cCM0tz3t9nZl8ys9ICn7fPzG40s95G/lsAwMzebmY/NbMRM9tfeftPKu8/v6elF7z/hkb3jfpjgEI1vC2l1Pv8H0m7K7evqLx/lqTXSnrffJ8n6VxJWyR9sm4dA8ALmNlHJP2lpM9KOk7SOknvlXSapP45e5wknT1n3/thYzpGI7U1ugEc+1JK+83sDklnLPDxATP7nqSX17czAJhlZssl/RdJ/y6ldOucD/1c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pF08AU3XybppsrbN2n2ztV0Fui9JaSU9qSUtlXeHpK0Q9LxaoFzf5Te8RvsYXXCHlZ/7F8xjRqgjpf0zJz3d6m1Nugk6Qdmdr+ZXdPoZhZhXUppT+XtvZLWNbKZRXi/mT1YuTzedJeQX8jMTpb0Skk/VYud+xf0LrXYua8h9rDGaqnH0Txa5nHE/rUwXkS+OK9PKZ0r6fckva9ymbYlpdnncFvpRzG/LGmzpHMk7ZH0uYZ24zCzXkm3SvpQSmlw7sea/dzP03tLnXscFXtY47TM44j96+gaNUANSNo45/0TKre1hJTSQOXv/ZK+pdnL+a1kX+V54uefL97f4H7CUkr7UkrllNKMpK+oic+9mZU0+wD+ekrpm5WbW+Lcz9d7K537OmAPa6yWeBzNp1UeR+xfvkYNUPdJOsXMXmJm7ZLeLum7Deoli5n1VF6YJjPrkfRmSduP/llN57uSrq68fbWk7zSwlyzPP3grrlCTnnszM0nXS9qRUvr8nA81/blfqPdWOfd1wh7WWE3/OFpIKzyO2L+Cx2pUkGblRwivlVSUdENK6c8a0kgmM9uk2e/YJKlN0jeauXczu1nSRZr9TdT7JP2ppG9L+jtJJ2r2t8tfmVJquhc6LtD7RZq9BJskPSnpPXOek28aZvZ6ST+U9JCkmcrNn9Dsc/FNfe6P0vtVaoFzXy/sYfXBHlZ/7F/BY5FEDgAAkIcXkQMAAGRigAIAAMjEAAUAAJCJAQoAACATAxQAAEAmBigAAIBMDFAAAACZGKAAAAAy/X9eBn4YChsI9AAAAABJRU5ErkJggg==\n", | ||
"text/plain": [ | ||
"<Figure size 720x360 with 2 Axes>" | ||
] | ||
}, | ||
"metadata": { | ||
"needs_background": "light" | ||
}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"i = 0\n", | ||
"plt.figure(figsize=(10,5))\n", | ||
"plt.subplot(1,2,1)\n", | ||
"plt.imshow(rec[i])\n", | ||
"plt.title('FBP');\n", | ||
"plt.subplot(1,2,2)\n", | ||
"plt.imshow(img[i])\n", | ||
"plt.title('GT');" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"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.7.9" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import torch | ||
from fast_transformers.builders import TransformerDecoderBuilder, TransformerEncoderBuilder | ||
|
||
from fit.transformers.PositionalEncoding2D import PositionalEncoding2D | ||
from fit.utils import convert2FC, convert_to_dft | ||
from torch.nn import functional as F | ||
|
||
|
||
class ConvBlockBaseline(torch.nn.Module): | ||
def __init__(self, | ||
d_query=32,): | ||
super(ConvBlockBaseline, self).__init__() | ||
|
||
self.conv_block = torch.nn.Sequential( | ||
torch.nn.Conv2d(1, d_query, kernel_size=3, stride=1, padding=1), | ||
torch.nn.ReLU(), | ||
torch.nn.BatchNorm2d(d_query), | ||
torch.nn.Conv2d(d_query, d_query, kernel_size=3, stride=1, padding=1), | ||
torch.nn.ReLU(), | ||
torch.nn.BatchNorm2d(d_query), | ||
torch.nn.Conv2d(d_query, 1, kernel_size=1, stride=1, padding=0) | ||
) | ||
|
||
def forward(self, x): | ||
img_post = self.conv_block(x) | ||
img_post += x | ||
|
||
return img_post |
Empty file.
Oops, something went wrong.