Skip to content

Commit 98f6450

Browse files
committed
update module 1 and add tags
1 parent ebe5aa3 commit 98f6450

10 files changed

+76
-67
lines changed

src/images_abstractions/abstraction.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### A Pluto.jl notebook ###
2-
# v0.19.14
2+
# v0.19.25
33

44
#> [frontmatter]
55
#> chapter = 1
@@ -11,7 +11,7 @@
1111
#> layout = "layout.jlhtml"
1212
#> youtube_id = "3zTO3LEY-cM"
1313
#> description = ""
14-
#> tags = ["lecture", "module1"]
14+
#> tags = ["lecture", "module1", "track_julia", "track_math"]
1515

1616
using Markdown
1717
using InteractiveUtils
@@ -274,7 +274,7 @@ version = "4.3.0"
274274
[[CompilerSupportLibraries_jll]]
275275
deps = ["Artifacts", "Libdl"]
276276
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
277-
version = "0.5.2+0"
277+
version = "1.0.1+0"
278278
279279
[[DataStructures]]
280280
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
@@ -666,7 +666,7 @@ version = "1.0.0"
666666
[[Tar]]
667667
deps = ["ArgTools", "SHA"]
668668
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
669-
version = "1.10.0"
669+
version = "1.10.1"
670670
671671
[[TensorCore]]
672672
deps = ["LinearAlgebra"]

src/images_abstractions/dynamicprograms.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#> layout = "layout.jlhtml"
1212
#> youtube_id = "KyBXJV1zFlo"
1313
#> description = ""
14-
#> tags = ["lecture", "module1"]
14+
#> tags = ["lecture", "module1", "optimization", "programming", "track_julia", "track_math", "interactive", "discrete", "lazy"]
1515

1616
using Markdown
1717
using InteractiveUtils

src/images_abstractions/images.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#> layout = "layout.jlhtml"
1212
#> youtube_id = "3zTO3LEY-cM"
1313
#> description = ""
14-
#> tags = ["lecture", "module1"]
14+
#> tags = ["lecture", "module1", "philip", "track_julia", "matrix", "image"]
1515

1616
using Markdown
1717
using InteractiveUtils

src/images_abstractions/linear_transformation.jl

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### A Pluto.jl notebook ###
2-
# v0.19.14
2+
# v0.19.25
33

44
using Markdown
55
using InteractiveUtils
@@ -25,29 +25,9 @@ end
2525
# ╔═╡ 2e8c4a48-d535-44ac-a1f1-4cb26c4aece6
2626

2727

28-
# ╔═╡ c0c90fec-0e55-4be3-8ea2-88b8705ee258
29-
md"""
30-
### Choose an image:
31-
32-
$(@bind img_source Select(img_sources))
33-
"""
34-
3528
# ╔═╡ 60532aa0-740c-11eb-0402-af8ff117f042
3629
md"Show grid lines $(@bind show_grid CheckBox(default=true))"
3730

38-
# ╔═╡ 8e0505be-359b-4459-9de3-f87ec7b60c23
39-
[
40-
if det_A == 0
41-
RGB(1.0, 1.0, 1.0)
42-
else
43-
in_x, in_y = invA*[out_x, out_y]
44-
trygetpixel(img, in_x, in_y)
45-
end
46-
47-
for out_y in LinRange(2, -2, 300),
48-
out_x in LinRange(-2, 2, 300)
49-
]
50-
5131
# ╔═╡ 35904b8e-7a28-4dbc-bbf9-b45da448452c
5232
let
5333

@@ -95,19 +75,19 @@ img_sources = [
9575
"https://images.squarespace-cdn.com/content/v1/5cb62a904d546e33119fa495/1589302981165-HHQ2A4JI07C43294HVPD/ke17ZwdGBToddI8pDm48kA7bHnZXCqgRu4g0_U7hbNpZw-zPPgdn4jUwVcJE1ZvWQUxwkmyExglNqGp0IvTJZamWLI2zvYWH8K3-s_4yszcp2ryTI0HqTOaaUohrI8PISCdr-3EAHMyS8K84wLA7X0UZoBreocI4zSJRMe1GOxcKMshLAGzx4R3EDFOm1kBS/fluffy+corgi?format=2500w" => "Alan"
9676
]
9777

78+
# ╔═╡ c0c90fec-0e55-4be3-8ea2-88b8705ee258
79+
md"""
80+
### Choose an image:
81+
82+
$(@bind img_source Select(img_sources))
83+
"""
84+
9885
# ╔═╡ 4fcb4ac1-1ad1-406e-8776-4675c0fdbb43
9986
img_original = load(download(img_source));
10087

10188
# ╔═╡ 52a8009e-761c-11eb-2dc9-dbccdc5e7886
10289
typeof(img_original)
10390

104-
# ╔═╡ 55898e88-36a0-4f49-897f-e0850bd2b0df
105-
img = if show_grid
106-
with_gridlines(img_original)
107-
else
108-
img_original
109-
end;
110-
11191
# ╔═╡ 7d0096ad-d89a-4ade-9679-6ee95f7d2044
11292
function trygetpixel(img::AbstractMatrix, x::Float64, y::Float64)
11393
rows, cols = size(img)
@@ -146,6 +126,26 @@ function with_gridlines(img::Array{<:Any,2}; n=8)
146126
return result
147127
end
148128

129+
# ╔═╡ 55898e88-36a0-4f49-897f-e0850bd2b0df
130+
img = if show_grid
131+
with_gridlines(img_original)
132+
else
133+
img_original
134+
end;
135+
136+
# ╔═╡ 8e0505be-359b-4459-9de3-f87ec7b60c23
137+
[
138+
if det_A == 0
139+
RGB(1.0, 1.0, 1.0)
140+
else
141+
in_x, in_y = invA*[out_x, out_y]
142+
trygetpixel(img, in_x, in_y)
143+
end
144+
145+
for out_y in LinRange(2, -2, 300),
146+
out_x in LinRange(-2, 2, 300)
147+
]
148+
149149
# ╔═╡ 00000000-0000-0000-0000-000000000001
150150
PLUTO_PROJECT_TOML_CONTENTS = """
151151
[deps]
@@ -244,7 +244,7 @@ version = "4.3.0"
244244
[[CompilerSupportLibraries_jll]]
245245
deps = ["Artifacts", "Libdl"]
246246
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
247-
version = "0.5.2+0"
247+
version = "1.0.1+0"
248248
249249
[[DataStructures]]
250250
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
@@ -636,7 +636,7 @@ version = "1.0.0"
636636
[[Tar]]
637637
deps = ["ArgTools", "SHA"]
638638
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
639-
version = "1.10.0"
639+
version = "1.10.1"
640640
641641
[[TensorCore]]
642642
deps = ["LinearAlgebra"]

src/images_abstractions/newton_method.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#> title = "The Newton Method"
1111
#> layout = "layout.jlhtml"
1212
#> youtube_id = "Wjcx9sNSLP8"
13-
#> description = ""
14-
#> tags = ["lecture", "module1"]
13+
#> description = "This lecture explains a method for finding the root of a function, but using code an illustrations instead of a chalkboard! We will illustrate the Newton method using the ForwardDiff.jl package to carry out automatic differentiation, but we will also try to understand what's going on \"under the hood\"."
14+
#> tags = ["lecture", "module1", "track_math", "continuous", "differentiation", "automatic differentiation", "ForwardDiff", "interactive", "Symbolics", "transformation"]
1515

1616
using Markdown
1717
using InteractiveUtils

src/images_abstractions/seamcarving.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#> layout = "layout.jlhtml"
1212
#> youtube_id = "KyBXJV1zFlo"
1313
#> description = ""
14-
#> tags = ["lecture", "module1"]
14+
#> tags = ["lecture", "module1", "image", "matrix", "track_julia", "track_climate", "track_data", "optimization", "interactive"]
1515

1616
using Markdown
1717
using InteractiveUtils
@@ -1874,14 +1874,14 @@ version = "1.4.1+0"
18741874
# ╟─5d6c1d74-8109-11eb-3529-bf2f23554b02
18751875
# ╟─48593d7c-8109-11eb-1b8b-6f15155d6ec9
18761876
# ╟─7038abe4-ef36-11ea-11a5-75e57ab51032
1877-
# ╠═8f523ba8-f52c-4269-90ca-1aa87948bdb9
1877+
# ╟─8f523ba8-f52c-4269-90ca-1aa87948bdb9
18781878
# ╟─abcafa92-f426-4653-a65e-149b41dd91bf
18791879
# ╟─1e0322f9-8737-401b-8b10-74f58d8e97ab
18801880
# ╟─fda2f181-e582-4d61-822c-7ee75e214aaa
18811881
# ╠═268c85cf-28c7-46ea-b343-b1214f75de33
18821882
# ╟─1fd26a60-f089-11ea-1f56-bb6eba7d9651
18831883
# ╟─dbacb273-02dc-4ff0-ac1a-3cc6785d3dac
1884-
# ╠═71b16dbe-f08b-11ea-2343-5f1583074029
1884+
# ╟─71b16dbe-f08b-11ea-2343-5f1583074029
18851885
# ╟─15d1e5dc-ef2f-11ea-093a-417108bcd495
18861886
# ╟─00000000-0000-0000-0000-000000000001
18871887
# ╟─00000000-0000-0000-0000-000000000002

src/images_abstractions/structure.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#> layout = "layout.jlhtml"
1212
#> youtube_id = "wZrVxbmX218"
1313
#> description = ""
14-
#> tags = ["lecture", "module1"]
14+
#> tags = ["lecture", "module1", "track_julia", "type", "programming", "matrix", "track_data", "structure"]
1515

1616
using Markdown
1717
using InteractiveUtils

src/images_abstractions/transformations2.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#> title = "Transformations II: Composability, Linearity and Nonlinearity"
1111
#> layout = "layout.jlhtml"
1212
#> youtube_id = "VDPf3RjoCpY"
13-
#> description = ""
14-
#> tags = ["lecture", "module1"]
13+
#> description = "Let's see what mathematical transformations, inverses, composition and (non-)linearity look like in practice. (i.e. applied to philip.jpg)"
14+
#> tags = ["lecture", "module1", "transformation", "track_math", "track_julia", "inverse", "composition", "matrix", "linear algebra", "nonlinear", "linear"]
1515

1616
using Markdown
1717
using InteractiveUtils

src/images_abstractions/transformations_and_autodiff.jl

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#> title = "Automatic Differentiation"
1111
#> layout = "layout.jlhtml"
1212
#> youtube_id = "AAREeuaKCic"
13-
#> description = ""
14-
#> tags = ["lecture", "module1"]
13+
#> description = "We use the package ForwardDiff.jl to automatically differentiate functions, on scalar and vector domains."
14+
#> tags = ["lecture", "module1", "track_julia", "track_math", "programming", "function", "transformation", "automatic differentiation", "continuous", "derivative"]
1515

1616
using Markdown
1717
using InteractiveUtils
@@ -55,12 +55,12 @@ In general if we perform both of these operations, we get a linear combination.
5555

5656
# ╔═╡ 2cca0638-7635-11eb-3b60-db3fabe6f536
5757
md"""
58-
# 4.1 Functions in Math and Julia
58+
# Functions in Math and Julia
5959
"""
6060

6161
# ╔═╡ c8a3b5b4-76ac-11eb-14f0-abb7a33b104d
6262
md"""
63-
### 4.1.1 Univariate Functions
63+
### Univariate Functions
6464
"""
6565

6666
# ╔═╡ db56bcda-76aa-11eb-2447-5d9076789244
@@ -101,14 +101,25 @@ f₃(5,2)
101101

102102
# ╔═╡ b3faf4d8-76ac-11eb-0be9-7dda3d37aba0
103103
md"""
104-
Keywords
104+
### Keyword arguments
105+
106+
After the regular (positional) arguments, a function definition can also accept keyword arguments. In the definition, these come after a semicolon `;`
105107
"""
106108

107109
# ╔═╡ 71c074f0-76ac-11eb-2164-c36381212bff
108-
f₄(x;α) = x^α
110+
f₄(x; α, β) = (x - β)^α
111+
112+
# ╔═╡ f263f6e6-b6c5-4c82-9a21-d6cdf34f725e
113+
md"""
114+
When calling a function with keyword arguments, you use the key:
115+
"""
109116

110117
# ╔═╡ 87b99c8a-76ac-11eb-1c94-8f1ffe3be593
111-
f₄(2, α=5)
118+
f₄(3, α=5, β=1)
119+
120+
# ╔═╡ 142eb253-6294-4426-bde2-7a9e2d6f2df4
121+
# the order of keyword arguments does not matter:
122+
f₄(3, β=1, α=5)
112123

113124
# ╔═╡ 504076fc-76ac-11eb-30c3-bfa75c991cb2
114125
md"""
@@ -117,7 +128,7 @@ See [Julia's function documentation](https://docs.julialang.org/en/v1/manual/fun
117128

118129
# ╔═╡ f1dd24d8-76ac-11eb-1de7-a763a1b95668
119130
md"""
120-
### 4.1.2 Automatic Differentiation of Univariates
131+
### Automatic Differentiation of Univariates
121132
"""
122133

123134
# ╔═╡ fe01da74-76ac-11eb-12e3-8320340b6139
@@ -156,7 +167,7 @@ end
156167

157168
# ╔═╡ f7df6cda-76b1-11eb-11e4-8d0af0349651
158169
md"""
159-
### 4.1.3 Scalar Valued Multivariate Functions
170+
### Scalar Valued Multivariate Functions
160171
"""
161172

162173
# ╔═╡ 63449b54-76b4-11eb-202f-3bda2f4cff4d
@@ -211,7 +222,7 @@ methods(f₅)
211222

212223
# ╔═╡ 6d411cea-76b9-11eb-061b-87d472bc3bdd
213224
md"""
214-
### 4.1.4 Automatic Differentiation: Scalar valued multivariate functions
225+
### Automatic Differentiation: Scalar valued multivariate functions
215226
"""
216227

217228
# ╔═╡ bc2c6afc-76b7-11eb-0631-51f83cd73205
@@ -253,7 +264,7 @@ md"""
253264

254265
# ╔═╡ a0afe3ae-76b9-11eb-2301-cde7260ddd7f
255266
md"""
256-
### 4.1.5. Transformations: Vector Valued Multivariate Functions
267+
### Transformations: Vector Valued Multivariate Functions
257268
"""
258269

259270
# ╔═╡ ac1ab224-76bb-11eb-13cb-0bd44bea1042
@@ -335,7 +346,7 @@ warp₂(1.0)([5.0,6.0])
335346

336347
# ╔═╡ 09ed6d38-76be-11eb-255b-3fbf76c21097
337348
md"""
338-
### 4.1.6 Automatic Differentiation of Transformations
349+
### Automatic Differentiation of Transformations
339350
"""
340351

341352
# ╔═╡ 9786e2be-76be-11eb-3755-b5669c37aa64
@@ -355,7 +366,7 @@ end
355366

356367
# ╔═╡ ad728ee6-7639-11eb-0b23-c37f1366fb4e
357368
md"""
358-
## 4.2 But what is a transformation, really?
369+
## But what is a transformation, really?
359370
You have very likely learned how to multiply matrices times vectors. I'll bet you think of a matrix as a table of numbers, and a vector as a column of numbers, and if you are well practiced, you know just when to multiply and just when to add.
360371
Congratulations, you now can do what computers excel at.
361372
@@ -446,12 +457,14 @@ md"""
446457
Computer Science
447458
Solving 2 equations in 2 unknowns, and higher dimensional analogs.
448459
449-
THe top 500 supercomputers, and how many equations in how many unknowns are being solved today.
460+
The top 500 supercomputers, and how many equations in how many unknowns are being solved today.
450461
"""
451462

452463
# ╔═╡ a66eb6fe-76b3-11eb-1d50-659ec2bf7c44
453464
md"""
454-
### 4.4 Automatic Differentiation in 10 mins(ok 11)
465+
### Automatic Differentiation in 10 minutes
466+
467+
*(okay, 11)*
455468
"""
456469

457470
# ╔═╡ b9dba026-76b3-11eb-1bfb-ffe9c43ced5d
@@ -1190,7 +1203,9 @@ version = "17.4.0+0"
11901203
# ╠═f4fa8c1a-76ab-11eb-302d-bd410432e3cf
11911204
# ╟─b3faf4d8-76ac-11eb-0be9-7dda3d37aba0
11921205
# ╠═71c074f0-76ac-11eb-2164-c36381212bff
1206+
# ╟─f263f6e6-b6c5-4c82-9a21-d6cdf34f725e
11931207
# ╠═87b99c8a-76ac-11eb-1c94-8f1ffe3be593
1208+
# ╠═142eb253-6294-4426-bde2-7a9e2d6f2df4
11941209
# ╟─504076fc-76ac-11eb-30c3-bfa75c991cb2
11951210
# ╟─f1dd24d8-76ac-11eb-1de7-a763a1b95668
11961211
# ╟─fe01da74-76ac-11eb-12e3-8320340b6139

src/images_abstractions/transforming_images.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#> layout = "layout.jlhtml"
1212
#> youtube_id = "uZYVjDDZW9A"
1313
#> description = ""
14-
#> tags = ["lecture", "module1"]
14+
#> tags = ["lecture", "module1", "image", "convolution", "track_math", "matrix", "philip"]
1515

1616
using Markdown
1717
using InteractiveUtils
@@ -46,11 +46,6 @@ md"""
4646
_When running this notebook for the first time, this could take up to 15 minutes. Hang in there!_
4747
"""
4848

49-
# ╔═╡ 4d332c7e-74f8-11eb-1f49-a518246d1db8
50-
md"""
51-
# Announcement: Lectures will be nearly an hour
52-
"""
53-
5449
# ╔═╡ f7689472-74a8-11eb-32a1-8379ae5c88e1
5550
rotabook = PlutoUI.Resource("https://i.gr-assets.com/images/S/compressed.photo.goodreads.com/books/1348902666l/1646354.jpg")
5651

@@ -1731,7 +1726,6 @@ version = "1.4.1+0"
17311726
# ╟─8d389d80-74a1-11eb-3452-f38eff03483b
17321727
# ╟─9f1a72da-7532-11eb-079c-b7baccc6614a
17331728
# ╠═86f770fe-74a1-11eb-01f7-5b3ecf057124
1734-
# ╟─4d332c7e-74f8-11eb-1f49-a518246d1db8
17351729
# ╟─f7689472-74a8-11eb-32a1-8379ae5c88e1
17361730
# ╟─0f2f9004-74a8-11eb-01a2-973dbe80f166
17371731
# ╠═962143a8-74a7-11eb-26c3-c10548f326ee
@@ -1789,7 +1783,7 @@ version = "1.4.1+0"
17891783
# ╠═d22903d6-7529-11eb-2dcd-132cd27104c2
17901784
# ╟─844ed844-74b3-11eb-2ee1-2de664b26bc6
17911785
# ╟─4ffe927c-74b4-11eb-23a7-a18d7e51c75b
1792-
# ╠═91109e5c-74b3-11eb-1f31-c50e436bc6e0
1786+
# ╟─91109e5c-74b3-11eb-1f31-c50e436bc6e0
17931787
# ╠═34109062-7525-11eb-10b3-d59d3a6dfda6
17941788
# ╟─9ab89a3a-7525-11eb-186d-29e4b61deb7f
17951789
# ╠═50034058-7525-11eb-345b-3334e71ac50e

0 commit comments

Comments
 (0)