Skip to content

Commit

Permalink
Reset & Clear Output
Browse files Browse the repository at this point in the history
  • Loading branch information
dldldlfma committed Mar 12, 2019
1 parent a73e7ad commit 10f5ef7
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 423 deletions.
216 changes: 40 additions & 176 deletions lab-10_3_1_visdom-example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -29,17 +29,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING:root:Setting up a new session...\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import visdom\n",
"vis = visdom.Visdom()"
Expand All @@ -54,22 +46,11 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
"'window_371a70736cec9c'"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"vis.text(\"Hello, world!\",env=\"main\")"
]
Expand All @@ -83,20 +64,9 @@
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'window_371a707d7964e2'"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"a=torch.randn(3,200,200)\n",
"vis.image(a)"
Expand All @@ -111,22 +81,11 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
"'window_371a708d402528'"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"vis.images(torch.Tensor(3,3,28,28))"
]
Expand All @@ -140,17 +99,9 @@
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Files already downloaded and verified\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"MNIST = dsets.MNIST(root=\"./MNIST_data\",train = True,transform=torchvision.transforms.ToTensor(), download=True)\n",
"cifar10 = dsets.CIFAR10(root=\"./cifar10\",train = True, transform=torchvision.transforms.ToTensor(),download=True)"
Expand All @@ -165,27 +116,9 @@
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"torch.Size([3, 32, 32])\n"
]
},
{
"data": {
"text/plain": [
"'window_371a70a62d1308'"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"data = cifar10.__getitem__(0)\n",
"print(data[0].shape)\n",
Expand All @@ -201,29 +134,11 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"torch.Size([1, 28, 28])\n"
]
},
{
"data": {
"text/plain": [
"'window_371a70af889fe0'"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"data = MNIST.__getitem__(0)\n",
"print(data[0].shape)\n",
Expand All @@ -239,7 +154,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -250,19 +165,11 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"torch.Size([32, 1, 28, 28])\n"
]
}
],
"outputs": [],
"source": [
"for num, value in enumerate(data_loader):\n",
" value = value[0]\n",
Expand All @@ -273,20 +180,9 @@
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"''"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"vis.close(env=\"main\")"
]
Expand All @@ -300,7 +196,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -310,7 +206,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -327,22 +223,11 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
"'window_371a70f95f8dee'"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"Y_append = torch.randn(1)\n",
"X_append = torch.Tensor([6])\n",
Expand All @@ -359,19 +244,9 @@
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"torch.Size([10])\n",
"torch.Size([10, 1])\n",
"torch.Size([10, 2])\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"num = torch.Tensor(list(range(0,10)))\n",
"num = num.view(-1,1)\n",
Expand All @@ -389,7 +264,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -398,7 +273,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -407,7 +282,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -423,7 +298,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -438,7 +313,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -458,20 +333,9 @@
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"''"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"vis.close(env=\"main\")"
]
Expand Down
Loading

0 comments on commit 10f5ef7

Please sign in to comment.