Skip to content

Commit

Permalink
Fix a few typos in notebooks and homeworks (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
pitmonticone authored Apr 8, 2023
1 parent ec6861b commit 5dec2e2
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 92 deletions.
4 changes: 2 additions & 2 deletions homeworks/hw0.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ First of all, **_welcome to the course!_** We are excited to teach you about rea
We'd like everyone to **submit this zeroth homework assignment**. It will not affect your grade, but it will help us get everything running smoothly when the course starts. If you're stuck or don't have much time, just fill in your name and ID and submit 🙂
Without submitting anything we'd also like you to login and try out Juliahub, which we will use later especially when we use GPUs. You might also try vscode on your own computer.
Without submitting anything we'd also like you to login and try out JuliaHub, which we will use later especially when we use GPUs. You might also try vscode on your own computer.
"""

# ╔═╡ 31a8fbf8-e6ce-11ea-2c66-4b4d02b41995
Expand All @@ -74,7 +74,7 @@ That’s it, but if you like you can do the _OPTIONAL_ exercises that follow."

# ╔═╡ 430a260e-6cbb-11eb-34af-31366543c9dc
md"""# Installation
Before being able to run this notebook succesfully locally, you will need to [set up Julia and Pluto.](https://computationalthinking.mit.edu/Spring21/installation/)
Before being able to run this notebook successfully locally, you will need to [set up Julia and Pluto.](https://computationalthinking.mit.edu/Spring21/installation/)
One you have Julia and Pluto installed, you can click the button at the top right of this page and follow the instructions to edit this notebook locally and submit.
"""
Expand Down
4 changes: 2 additions & 2 deletions homeworks/hw1a.jl
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ end;

# ╔═╡ 4885f35e-1875-4dca-8bad-f8ae94cb98b3
md"""
First, `friends_naive` is more tedious to write and read, beause everything has to be in the same place.
First, `friends_naive` is more tedious to write and read, because everything has to be in the same place.
Second, it is not easy to extend _a posteriori_.
And third, this paradigm often leads to less efficient functions.
Indeed, since multiple dispatch selects the appropriate method based on argument types, it can generate shorter machine code than the full `if / else` statement.
Expand All @@ -496,7 +496,7 @@ md"""


# ╔═╡ c491ca01-5a0b-4f91-825c-67f597aa788a
hint(md"You might get an arror due to an ambiguous method. This means multiple dispatch has failed because there is no single most specific implementation. How do you fix this?")
hint(md"You might get an error due to an ambiguous method. This means multiple dispatch has failed because there is no single most specific implementation. How do you fix this?")

# ╔═╡ d96068be-4ac9-4ff9-ae3e-4807df555a42
md"""
Expand Down
4 changes: 2 additions & 2 deletions homeworks/hw2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ md"""
# ╔═╡ 48511240-20d1-41b6-bc7b-a8ecfc3aa06d
md"""
Since Julia is a high-level language, you don't need to care about memory to write correct code.
New objects are allocated transparently, and once you no longer need them, the Garbage Collector (GC) automaticaly frees their memory slots.
New objects are allocated transparently, and once you no longer need them, the Garbage Collector (GC) automatically frees their memory slots.
However, in many cases, memory management is a performance bottleneck.
If you want to write fast code, you might need to work "in place" (mutating existing arrays), as opposed to "out of place" (creating many temporary arrays).
Expand Down Expand Up @@ -396,7 +396,7 @@ md"""
md"""
Alas, every autodiff package comes with its own limitations.
Here are the main ones you should be aware of:
- `ForwardDiff.jl` requires functions that work with generic number types, not just `Float64` for example. The reason is that forward mode relies on numbers of type `Dual` (whch store both a quantity and its derivative)
- `ForwardDiff.jl` requires functions that work with generic number types, not just `Float64` for example. The reason is that forward mode relies on numbers of type `Dual` (which store both a quantity and its derivative)
- `Zygote.jl` requires functions that avoid mutating arrays. The reason is that array mutation gives rise to several nodes in the computational graph for a single variable in the code, which is complicated to handle from an implementation perspective.
"""

Expand Down
4 changes: 2 additions & 2 deletions notebooks/1_abstraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ PlutoUI.TableOfContents(aside=true)

# ╔═╡ 792c6a62-ec41-11ea-01f3-73e7eee23cc7
md"""
#### Intializing packages
#### Initializing packages
_When running this notebook for the first time, this could take up to 15 minutes. Hang in there!_
"""
Expand All @@ -103,7 +103,7 @@ md"Each of the items in this list is a specific, or **_specialized_** representa
1. as an 2x2 identity matrix
1. as a singular dog
Of course, these are just a few examples of _one_. People have been representing _one_ for ages in different langauges, scripts, artistic expression, etc.
Of course, these are just a few examples of _one_. People have been representing _one_ for ages in different languages, scripts, artistic expression, etc.
The difference between these ones to me is clear. In fact, I just articulated it to you. Now, let's turn to how a computer sees _one_ differently based on what I type.
"
Expand Down
2 changes: 1 addition & 1 deletion notebooks/2_matrix_jacobians.jl
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ expand.( kron(I2,X^2) + kron(X',X) + kron(X'^2,I2) )
md"""
# 3) The LU Decomposition
Recall the LU Decomposition factors a matrix into unit lower-trianguar and upper triangular:
Recall the LU Decomposition factors a matrix into unit lower-triangular and upper triangular:
"""

# ╔═╡ c28d1043-259f-4045-8148-031da91dc818
Expand Down
6 changes: 3 additions & 3 deletions notebooks/3_symmetric_eigenvalue_derivatives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ so that $(I-xx^T)Ax$ is the gradient of ``\frac{1}{2}x^TAx`` on the sphere.
To get the gradient we needed two things:
* A linearization of the function that is correct on tangents and
* A direction that is tangent (satisifes the linearized constraint)
* A direction that is tangent (satisfies the linearized constraint)
### Gradient of a general scalar function on the sphere:
``df= g(x)^T dx = ((I-xx^T)g(x))^Tdx``
Project the unconstrainted gradient to the sphere to get the constrained gradient. It is the direction of maximal increase on the sphere.
Project the unconstrained gradient to the sphere to get the constrained gradient. It is the direction of maximal increase on the sphere.
"""
Expand Down Expand Up @@ -148,7 +148,7 @@ md"""

# ╔═╡ 1023e972-bd69-45ae-974a-1a093a57ece4
md"""
`` S = Q \Lambda Q^T`` is the eigendecomposition of a symmetric ``S`` with ``\Lambda`` diagonal containing eigenvalues, and ``Q`` othogonal with columns as eigenvectors.
`` S = Q \Lambda Q^T`` is the eigendecomposition of a symmetric ``S`` with ``\Lambda`` diagonal containing eigenvalues, and ``Q`` orthogonal with columns as eigenvectors.
$(br)
``dS = dQ \Lambda Q^T + Q d\Lambda Q^T + Q Λ dQ^T`` which may be written
Expand Down
Loading

0 comments on commit 5dec2e2

Please sign in to comment.