diff options
author | aktersnurra <gustaf.rydholm@gmail.com> | 2020-11-08 12:41:04 +0100 |
---|---|---|
committer | aktersnurra <gustaf.rydholm@gmail.com> | 2020-11-08 12:41:04 +0100 |
commit | beeaef529e7c893a3475fe27edc880e283373725 (patch) | |
tree | 59eb72562bf7a5a9470c2586e6280600ad94f1ae /src/notebooks/01-look-at-emnist.ipynb | |
parent | 4d7713746eb936832e84852e90292936b933e87d (diff) |
Trying to get the CNNTransformer to work, but it is hard.
Diffstat (limited to 'src/notebooks/01-look-at-emnist.ipynb')
-rw-r--r-- | src/notebooks/01-look-at-emnist.ipynb | 184 |
1 files changed, 0 insertions, 184 deletions
diff --git a/src/notebooks/01-look-at-emnist.ipynb b/src/notebooks/01-look-at-emnist.ipynb index d727cb4..0ef77b6 100644 --- a/src/notebooks/01-look-at-emnist.ipynb +++ b/src/notebooks/01-look-at-emnist.ipynb @@ -49,169 +49,6 @@ }, { "cell_type": "code", - "execution_count": 37, - "metadata": {}, - "outputs": [], - "source": [ - "from torch.utils.data import random_split, DataLoader" - ] - }, - { - "cell_type": "code", - "execution_count": 38, - "metadata": {}, - "outputs": [], - "source": [ - "d1, d2 = random_split(dataset, [len(dataset)-10, 10])" - ] - }, - { - "cell_type": "code", - "execution_count": 39, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "55898" - ] - }, - "execution_count": 39, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(d1)" - ] - }, - { - "cell_type": "code", - "execution_count": 40, - "metadata": {}, - "outputs": [], - "source": [ - "dl = DataLoader(d1, batch_size=16)" - ] - }, - { - "cell_type": "code", - "execution_count": 41, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "3494" - ] - }, - "execution_count": 41, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(dl)" - ] - }, - { - "cell_type": "code", - "execution_count": 42, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "tensor([[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 4, 4, 4, 4, 4, 2, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 2, 4, 9, 32, 37, 37, 37, 32, 20, 1, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 3, 65, 109, 140, 204, 215, 217, 217, 201, 154, 22, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,\n", - " 12, 122, 190, 222, 245, 249, 250, 250, 242, 206, 46, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 79,\n", - " 127, 222, 247, 253, 235, 228, 249, 254, 254, 245, 114, 4, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 35, 91, 219,\n", - " 244, 252, 247, 207, 100, 84, 223, 251, 254, 250, 127, 4, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 91, 163, 246,\n", - " 252, 244, 220, 127, 39, 48, 218, 250, 255, 250, 127, 4, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 5, 20, 95, 219, 246, 246,\n", - " 221, 127, 79, 10, 5, 37, 217, 250, 254, 249, 125, 4, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 20, 67, 175, 246, 252, 219,\n", - " 164, 47, 22, 1, 5, 39, 218, 250, 254, 245, 114, 4, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 1, 9, 95, 175, 250, 246, 219, 91,\n", - " 35, 1, 0, 0, 22, 84, 234, 252, 250, 220, 50, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 9, 35, 164, 221, 252, 219, 163, 35,\n", - " 9, 0, 0, 0, 46, 127, 246, 254, 245, 204, 34, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 7, 91, 163, 246, 252, 219, 91, 35, 1,\n", - " 0, 0, 0, 10, 128, 209, 254, 254, 220, 139, 9, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 3, 22, 159, 219, 252, 247, 164, 35, 9, 0,\n", - " 0, 0, 1, 36, 175, 233, 254, 254, 204, 115, 4, 0, 0, 0],\n", - " [ 0, 0, 0, 1, 36, 95, 232, 251, 232, 195, 47, 1, 0, 0,\n", - " 0, 9, 35, 163, 246, 253, 249, 232, 122, 45, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 7, 91, 164, 247, 251, 187, 127, 20, 0, 0, 0,\n", - " 1, 35, 91, 219, 253, 254, 234, 187, 67, 20, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 46, 207, 244, 247, 220, 80, 24, 1, 3, 8, 34,\n", - " 52, 164, 219, 253, 249, 234, 155, 79, 4, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 2, 81, 232, 251, 235, 179, 39, 12, 5, 22, 46, 115,\n", - " 139, 221, 246, 254, 234, 188, 79, 32, 0, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 3, 112, 244, 254, 236, 193, 130, 127, 129, 173, 209, 245,\n", - " 250, 254, 253, 232, 154, 79, 4, 0, 0, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 46, 206, 242, 249, 248, 249, 250, 250, 250, 250, 250,\n", - " 250, 243, 219, 95, 22, 7, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 22, 154, 201, 217, 222, 245, 249, 249, 233, 222, 217,\n", - " 217, 202, 158, 36, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 1, 20, 32, 39, 51, 114, 125, 125, 82, 51, 37,\n", - " 37, 32, 20, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 2, 4, 5, 9, 32, 37, 37, 21, 9, 4,\n", - " 4, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", - " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],\n", - " dtype=torch.uint8)" - ] - }, - "execution_count": 42, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "d1.dataset.data[0]" - ] - }, - { - "cell_type": "code", - "execution_count": 43, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "torch.Tensor" - ] - }, - "execution_count": 43, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "type(dataset.data)" - ] - }, - { - "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ @@ -288,27 +125,6 @@ "source": [ "display_images(dataset, 9)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { |