Skip to content

Commit 312f8dd

Browse files
committed
minor mods
1 parent 0b3c6ca commit 312f8dd

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Chapter1_Tensors/Statistics.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
"cell_type": "markdown",
227227
"metadata": {},
228228
"source": [
229-
"Q3. Return the 3 smallestt elements and their indices along the second dimension."
229+
"Q3. Return the 3 smallest elements and their indices along the second dimension."
230230
]
231231
},
232232
{
@@ -473,7 +473,7 @@
473473
"cell_type": "markdown",
474474
"metadata": {},
475475
"source": [
476-
"Q9. Compute the variance of X along the second axis without the Bessel's correction."
476+
"Q9. Compute the variance of X along the second axis without Bessel's correction."
477477
]
478478
},
479479
{
@@ -509,7 +509,7 @@
509509
"cell_type": "markdown",
510510
"metadata": {},
511511
"source": [
512-
"Q10. Compute the std of X along the second axis with the Bessel's correction."
512+
"Q10. Compute the std of X along the second axis with Bessel's correction."
513513
]
514514
},
515515
{
@@ -568,7 +568,7 @@
568568
"name": "python",
569569
"nbconvert_exporter": "python",
570570
"pygments_lexer": "ipython2",
571-
"version": "2.7.10"
571+
"version": "2.7.12"
572572
}
573573
},
574574
"nbformat": 4,

Chapter1_Tensors/Statistics_solution.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
" [[1, 2, 2, 4, 4],\n",
218218
" [5, 8, 7, 8, 5]])\n",
219219
"\n",
220-
"top3, indices = X.topk(3)\n",
220+
"top3, indices = X.topk(3, dim=1)\n",
221221
"print(\"• the 3 largest values=\", top3)\n",
222222
"print(\"• the first indices=\", indices)"
223223
]
@@ -226,7 +226,7 @@
226226
"cell_type": "markdown",
227227
"metadata": {},
228228
"source": [
229-
"Q3. Return the 3 smallestt elements and their indices along the second dimension."
229+
"Q3. Return the 3 smallest elements and their indices along the second dimension."
230230
]
231231
},
232232
{
@@ -466,7 +466,7 @@
466466
"X = torch.Tensor([[1,1,0,0,3],\n",
467467
" [3,4,1,1,1]])\n",
468468
"\n",
469-
"modes, indices = X.mode()\n",
469+
"modes, indices = X.mode(dim=1)\n",
470470
"print(\"• modes=\", modes)\n",
471471
"print(\"• the last indices=\", indices)\n",
472472
"\n",
@@ -477,7 +477,7 @@
477477
"cell_type": "markdown",
478478
"metadata": {},
479479
"source": [
480-
"Q9. Compute the variance of X along the second axis without the Bessel's correction."
480+
"Q9. Compute the variance of X along the second axis without Bessel's correction."
481481
]
482482
},
483483
{
@@ -517,7 +517,7 @@
517517
"cell_type": "markdown",
518518
"metadata": {},
519519
"source": [
520-
"Q10. Compute the std of X along the second axis with the Bessel's correction."
520+
"Q10. Compute the std of X along the second axis with Bessel's correction."
521521
]
522522
},
523523
{
@@ -579,7 +579,7 @@
579579
"name": "python",
580580
"nbconvert_exporter": "python",
581581
"pygments_lexer": "ipython2",
582-
"version": "2.7.10"
582+
"version": "2.7.12"
583583
}
584584
},
585585
"nbformat": 4,

0 commit comments

Comments
 (0)