-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmachine_learning_tutorial_notebook.jl
2162 lines (1725 loc) · 73.8 KB
/
machine_learning_tutorial_notebook.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
### A Pluto.jl notebook ###
# v0.19.12
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
local el = $(esc(element))
global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el)
el
end
end
# ╔═╡ 6e577570-0c29-11eb-11a3-91fc867a908e
begin
using Random
using Flux.Data: DataLoader
using Flux: params, update!
using Flux # for deep learning and autodiff
using MLJ: make_blobs, make_circles, make_moons, partition # utilities for data set creation and others
using MLJBase: matrix
using Statistics
using Plots
plotly()
hint(text) = Markdown.MD(Markdown.Admonition("hint", "Solution", [text]));
question(text) = Markdown.MD(Markdown.Admonition("question", "Question", [text]));
tip(text) = Markdown.MD(Markdown.Admonition("tip", "Tip", [text]));
using Printf
using InteractiveUtils
using PlutoUI
end
# ╔═╡ 088beae0-0b62-11eb-0f0e-9f29aa060ed2
md"""
# Machine Learning Tutorial with Julia
In this simple tutorial we will go through the standard Machine Learning workflow of choosing and tuning a model.
The tutorial will use synthetic data.
"""
# ╔═╡ 55023282-0b62-11eb-1c12-4942101aece9
md"""
## 1. Load the datasets and explore
The first part of a machine learning project is to get familiar with the dataset and formulate clearly the problem that we want to solve. In other words, answering the question what do we want our model to do?
"""
# ╔═╡ 9f1937ee-0b63-11eb-154d-0f51431234ec
md"""
In this tutorial we will use synthetic data. The first dataset consists of 2 blobs drawn from two Gaussian distributions. The second dataset consists of concentric circles.
You can play around with the number of data points using the variables below.
"""
# ╔═╡ f5ac26e2-0b63-11eb-12e0-7d668db8003a
n_pts = 100;
# ╔═╡ ffc6c7d0-0b62-11eb-1a2b-53fa23f8ac25
md"""
Generate Gaussian blobs
"""
# ╔═╡ 7ed6a250-0b65-11eb-1fe4-3db1ebb1884f
X_blob, Y_blob = make_blobs(n_pts, 2, centers=2, rng=MersenneTwister(10), center_box=(0.0=>1), cluster_std=0.1);
# ╔═╡ 24abdc10-0b64-11eb-0125-8ba3e1a096aa
scatter(X_blob.x1, X_blob.x2, color=convert.(Int64, Y_blob), legend=false)
# ╔═╡ 549d27c0-0b65-11eb-0246-754f34082820
md"""
Generate concentric circles
"""
# ╔═╡ 468dd460-0b63-11eb-3b18-db9930297f4a
X_circle, Y_circle = make_circles(n_pts, factor=0.7, noise=0.05);
# ╔═╡ 5ed99e00-0b63-11eb-1dac-b5d788680860
scatter(X_circle.x1, X_circle.x2, color=convert.(Int64, Y_circle), aspect_ratio=:equal, legend=false)
# ╔═╡ d8974f70-0d03-11eb-01e1-5b8d9c77bfdc
X_moon, Y_moon = make_moons(n_pts, noise=0.05);
# ╔═╡ f6fdc022-0d03-11eb-3b9d-3d9baff1e067
scatter(X_moon.x1, X_moon.x2, color=convert.(Int64, Y_moon), aspect_ratio=:equal, legend=false)
# ╔═╡ 6d5a3452-0b66-11eb-1617-77d692d84564
md"""
## 2. Problem formulation
In this tutorial, the goal is to build a model, that can automatically classify whether a point in a 2D space belongs to one class or the other.
The model we are looking for is a function $f: \mathbb{R}^2 \rightarrow \{0, 1\}$ parameterized by $\theta$.
We will learn a discriminative model, that is, we assume that $f(x;\theta) = P(y=1 | x)$.
A common assumption is to assume that each datapoint is drawn independently from the same distribution. With that assumption and objective in mind, we can show that maximizing the log likelihood of our data is equivalent to solving:
Under this probabilistic approach, we can find a function $f$ that maximizes the likelihood of the dataset. The optimization problem can be formulated as follows:
$$\max_{\theta} \prod_{(x,y)\in\mathcal{D}} P(y | x; \theta) $$
$$ \max_{\theta} \log(\prod_{(x,y)\in\mathcal{D}} P(y | x; \theta)) $$
$$ \max_{\theta} \sum_{(x,y)\in\mathcal{D}} \log(P(y | x; \theta)) $$
or
$$\min_{\theta} \frac{1}{|\mathcal{D}|}\sum_{(x,y)\in\mathcal{D}} L(x, y; \theta)$$
We need to choose, $L$ such that our model reflects the true distribution of the data,
where
$$L(x, y; \theta) = -y \log(f_{\theta}(x)) - (1 - y)\log(1 - f_{\theta}(x))$$
"""
# ╔═╡ bd9655c0-0be3-11eb-00a9-ddf68bdb4673
function loss(x, y, model)
return -mean(y.*log.(model(x)) .+ (1.0 .- y).*log.(1.0 .- model(x)))
end
# ╔═╡ a7450776-8517-4743-a992-9b5cd19f191c
question(md"""
Implement a regularized loss function with L2 regularization
""")
# ╔═╡ db912528-0c08-437a-8317-2381f6aead65
hint(md"""
you can retrieve the parameters for a model using `model.weight` and `model.bias`
Click on the eye to see the solution in the cell below
""")
# ╔═╡ c005e0c7-24cc-48fa-a844-2f7ae5088f00
function regularized_loss(x, y, model, λ=0.01)
return loss(x, y, model) + λ*norm(model.weight, 2) + λ*norm(model.bias, 2)
end
# ╔═╡ 1519a2b0-0be5-11eb-00ad-099ce6a6a134
md"""
Before we choose the model class and train it, let's decide on an evaluation metrics. It is important to understand that there are often trade offs between the different objectives. Domain knowledge often dictates whether one is more important than the other. There are several candidates for classification problems:
- accuracy
- false positive rate
- false negative rate
- area under the curve
- f1 score
In this tutorial we will choose accuracy. Accuracy is the ratio of correctly classified examples over the total number of examples.
"""
# ╔═╡ 2e16ec92-0be6-11eb-30a5-a7701a02a792
function evaluate(ŷ, y)
return sum(y .== ŷ) / length(y)
end
# ╔═╡ bd7fb920-0be6-11eb-36c0-afd7d1e5979b
md"""
## 3. Train, Evaluate, Repeat
Now that we have the dataset, and formulated our problem it is time to choose a model and train it. The training process involve the following tasks:
- Feature selection: choosing the input to our model
- Model selection: choosing the class of functions that we want to use to fit our data
- Hyperparameter tuning: choosing the hyperparameters
- Train: run an optimization algorithm to find the parameters $\theta$ of your model
- Evaluate: evaluate the performance of the trained model.
- Repeat: this is an iterative procedure, it is very likely that your first choice of model and hyperparameters will not yield good results.
The next section will show how we can automate this whole procedure.
"""
# ╔═╡ 7c62e920-0be7-11eb-0f99-1b7eaad426ec
md"""
### Model Selection
The model class that we choose can affect different aspects:
- expressivity of the function: to what extent can we represent complex patterns)
- training speed: how fast it takes to train the model
- inference speed: how fast it takes to run the model on a data point
In this tutorial we will use [Flux.jl](https://github.com/FluxML/Flux.jl) to construct the model. Flux is a deep learning library that allows you to construct neural networks in a very easy way.
It relies on an autodifferentiation library, [Zygote.jl](https://github.com/FluxML/Zygote.jl) that can take gradients of functions automatically and efficiently.
Let's construct our model. The simplest model we can think of is a logistic regression:
$$f(x; \theta) = \sigma(\theta^\top x)$$
where
$$\sigma(x) = \frac{1}{1 + \exp(-x)}$$
In logistic regression we assume a linear combination of model weights and input, but it can be generalized to non-linear functions. We could use a deep neural network for example with the last activation layer being a sigmoid function.
"""
# ╔═╡ f2d7cbf0-0c39-11eb-20a0-47c3d72d22f0
question(md"""
**How does logistic regression relate to neural network?**
""")
# ╔═╡ 0e6971c2-0c3a-11eb-19b8-73a32ae79473
hint(md"""
The logistic regression model can be described as a neural network with zero hidden layer. It only has an output layer.
"""
)
# ╔═╡ 9f6a4740-0be9-11eb-20f7-affaacd9a460
"""
initialize_model(n_inputs, hiddens)
Initialize a multi layer perceptron.
Examples: initialize_model(2, [32,32]) # 2 hidden layers with 32 nodes each
"""
function initialize_model(n_inputs, hiddens)
# the chain operator allows us to call functions after another f(g(h(x))) = Chain(f, g, h)
if isempty(hiddens)
return Chain(Dense(n_inputs, 1, sigmoid))
end
layers = []
# add layers one at a time
push!(layers, Dense(n_inputs, hiddens[1], relu))
for i=1:length(hiddens)-1
push!(layers, Dense(hiddens[i], hiddens[i+1], relu))
end
push!(layers, Dense(hiddens[end], 1, sigmoid))
return Chain(layers...)
end
# ╔═╡ 83b2a310-0c0e-11eb-1a3a-f1d266f05a81
question(md"""
**Note that the model outputs a number between 0 and 1, how can we make prediction, output either 0 or 1 with the model?**
""")
# ╔═╡ c6244c50-0c1b-11eb-0f17-0d84adbe2f73
hint(md"""
To make a prediction with our model we will compare the output with 0.5.
$\hat{y} = 1 \text{ if } f(x;\theta) > 0.5 \text{ else } 0$
""")
# ╔═╡ 2bbbfd10-0c1c-11eb-3bd7-2370e3cdc74d
md"""
Implement the predict function below:
"""
# ╔═╡ c1541280-0c0e-11eb-3e99-d59f27ae2581
function predict(x, model)
# todo: implement the prediction function (1 line)
return model(x) .> 0.5
end
# ╔═╡ 65e0e760-0c05-11eb-1226-81a5e9d5b658
md""""
### Feature selection and Preprocessing
Before training the model we are going to format our dataset such that it is suitable for training.
The steps are the following:
- Make the y labels between 0 and 1
- Split the dataset into train and test
- Normalize the dataset (we will skip this part in the example but it usually is very important!)
- Split the training data into mini-batches
"""
# ╔═╡ 3261d180-0c3a-11eb-163b-9fbc71570323
question(md"""
**Can you think of a way of augmenting the feature space to fit the circle dataset with just a linear regression module? Implement it below.**
""")
# ╔═╡ 4d1dfee0-0c3a-11eb-141f-f9d612d2be4b
hint(md"""
By adding four features: $x_1^2$, $x_2^2$, $x_1x_2$, and a bias term $1$ we can hope to model circles using only a linear classifier
""")
# ╔═╡ 0e523c10-0c41-11eb-2754-678393016da7
function feature_augmentation(x)
# todo implement feature augmentation
new_x = x
# dim, bs = size(x)
# new_x = hcat(x[1,:],x[2,:], x[1,:].^2, x[2,:].^2, x[1,:].*x[2,:], ones(bs))'
return new_x
end
# ╔═╡ 9a458832-0c05-11eb-3fe5-b190450b9d11
function process_data(X, Y)
x = matrix(X, transpose=true)
# make sur Y is between 0 and 1
y = convert(Vector{Float64}, Y)
if !(minimum(y) ≈ 0)
y = y .- 1.0
end
y = reshape(y, (1,:))
# split in train and test
train, test = partition(eachindex(y), 0.7, shuffle=true);
x = feature_augmentation(x)
return x[:, train], y[:,train], x[:, test], y[:,test]
end
# ╔═╡ d0fc070e-0beb-11eb-16ee-697d37d49d4f
md"""
### Training
Now let's train the model using Stochastic Gradient descent
We have a few hyperparameters to define for the training.
- Learning rate $\eta$: dictate the step size of each parameter update in the direction in the descending gradient
- Batch size: how many data points to use to compute each gradient update.
- Number of epochs: how many times to go through the whole dataset.
Note that the model parameters can also be considered as hyperparameters, the number of nodes, number of layers, activation functions (for NNs).
"""
# ╔═╡ f24ad132-0c18-11eb-2a00-b53f3d4fbfc3
md"""
Let's now construct the inner loop of our training procedure.
"""
# ╔═╡ ed924a00-0c4b-11eb-37a1-a34c473d1844
question(md"""**We are given a minibatch of data and a model, what are the main steps of the training procedure? Implement the `train!` function below.** """)
# ╔═╡ 656d4dee-0c19-11eb-0a5a-ebc625112762
hint(md"""
It consists of the following:
- compute loss function on mini batch
- take gradients of the loss with respect to model parameters
- update model parameters
- evaluate the model to track progress
""")
# ╔═╡ 51c52db0-0c17-11eb-06f4-738684d02128
md"""
We are then wrapping the whole pipeline into one whole function.
"""
# ╔═╡ fc91dbb0-0c4b-11eb-0216-bd16bfc8bf7d
question(md"""
**What are the inputs to that function?**
""")
# ╔═╡ 0b00fff0-0c1a-11eb-181e-f774368ddf23
hint(md"""This function takes as input, the processed data, the hyperparameters and the model, and perform training and evaluation.""")
# ╔═╡ 80484ac0-0c15-11eb-1f65-e370ce717e03
md"""
We define a few plotting functions below, click on the eye to see the code
"""
# ╔═╡ 529fda72-0c10-11eb-0654-df3883c69244
function plot_training_summary(n_epochs, train_loss, test_loss, train_accuracy, test_accuracy)
p1 = plot(1:n_epochs, train_loss, color=:blue, label="train loss")
plot!(p1, 1:n_epochs, test_loss, color=:orange, label="test loss")
p2 = plot(1:n_epochs, train_accuracy, color=:red, label="train accuracy")
plot!(p2, 1:n_epochs, test_accuracy, color=:green, label="test accuracy")
return plot(p1, p2, layout=(2,1))
end
# ╔═╡ 77831d20-0c15-11eb-0665-15190accb287
function plot_decision_boundary(xtrain, ytrain, xtest, ytest, model, boundary=true)
X = hcat(xtrain, xtest)
xlim = minimum(X[1,:]):0.01:maximum(X[1,:])
ylim = minimum(X[2,:]):0.01:maximum(X[2,:])
preprocessing = x -> feature_augmentation(reshape(x, (2,size(x,2))))
if boundary
fun = x -> predict(preprocessing(x), model)
else
fun = model(preprocessing(x))
end
contour(xlim, ylim, (x,y) -> fun([x,y])[1], fill=true, color=[0,1], alpha=0.5, colorbar=false)
scatter!(xtrain[1,:], xtrain[2,:], color=convert.(Int64, ytrain[:]), label="training set")
scatter!(xtest[1,:], xtest[2,:], color=convert.(Int64, ytest[:]), label="test set", markerstrokecolor=:red)
end
# ╔═╡ 2162d3e0-0c1a-11eb-2ae1-37197227b4f2
begin
hiddens_dict = Dict("[]"=> [],
"[2]" => [2],
"[4]" => [4],
"[32]"=> [32],
"[4,4]"=>[4,4],
"[32,32]"=> [32,32],
"[32,32,32]" => [32,32,32])
md"""
Let's build intuition on the effect of each hyperparameter
**Learning rate**: $(@bind η NumberField(0.00 : 0.0001 : 0.90, default=0.01))
**Batch size:** $(@bind bs Slider(1:1:n_pts, show_value=true, default=32))
**Model structure:** $(@bind hiddens_str Select(collect(keys(hiddens_dict))))
**Number of epochs**: $(@bind n_epochs Slider(3:1:300, show_value=true, default=20))
"""
end
# ╔═╡ d14cf528-d64a-421d-8c2b-e52bb12994db
hiddens = hiddens_dict[hiddens_str]
# ╔═╡ df1cf190-0c38-11eb-19c3-ad809987a01d
question(md"""
**Exercise 1**: Re-run the notebook with the circle dataset instead
**Exercise 2**: Can you think of a way to fit the circle using a logistic regression model.
""")
# ╔═╡ 205cd9d0-2243-46dd-a062-48cf8012d4b7
X_data, Y_data = X_circle, Y_circle;
# ╔═╡ b1303b30-0c05-11eb-1629-033109ccf3c4
xtrain, ytrain, xtest, ytest = process_data(X_data, Y_data);
# ╔═╡ 87254020-0c04-11eb-13a2-03b0711e2f83
function train!(train_data, test_data, opt, model)
θ = params(model)
train_loss = 0.0
for (x,y) in train_data
# compute gradients and update parameters
local minibatch_loss
∇θ = gradient(θ) do
minibatch_loss = loss(x, y, model)
end
update!(opt, θ, ∇θ)
train_loss += minibatch_loss
end
train_loss /= length(train_data)
test_loss = loss(test_data..., model)
train_accuracy = evaluate(predict(xtrain, model), ytrain)
test_accuracy = evaluate(predict(xtest, model), ytest)
training_summary = @sprintf("Train loss: %4.3f | Test loss: %4.3f | Train accuracy: %4.3f | Test accuracy %4.3f", train_loss, test_loss, train_accuracy, test_accuracy)
return train_loss, test_loss, train_accuracy, test_accuracy, training_summary
end
# ╔═╡ e599ea70-0c18-11eb-14ca-b541ef9de76e
function train_many_epochs!(n_epochs, train_data, test_data, opt, model)
train_loss = zeros(n_epochs)
test_loss = zeros(n_epochs)
test_accuracy = zeros(n_epochs)
train_accuracy = zeros(n_epochs)
training_summary = ""
for i=1:n_epochs
# run training
train_loss[i], test_loss[i], train_accuracy[i], test_accuracy[i], training_summary = train!(train_data, test_data, opt, model)
end
p1 = plot_training_summary(n_epochs, train_loss, test_loss, train_accuracy ,test_accuracy)
p2 = plot_decision_boundary(xtrain, ytrain, xtest, ytest, model)
return plot(p1, p2, layout=(2, 1), legend=:bottomright), training_summary
end
# ╔═╡ cbfd84f2-0c18-11eb-2307-55f2f1646fe1
function train_and_evaluate!((xtrain,ytrain), (xtest, ytest), η, bs, n_epochs, model_hyperparams)
model = initialize_model(model_hyperparams...)
# collect the dataset in minibatch
train_data = DataLoader((data=xtrain, label=ytrain), batchsize=bs, shuffle=true)
test_data = (xtest, ytest)
# initialize the optimizer (the choice of the optimizer can be a hyper parameter as well)
opt = Descent(η)
return train_many_epochs!(n_epochs, train_data, test_data, opt, model)
end
# ╔═╡ 23df9b10-0c17-11eb-3249-2906e0c79309
n_inputs = size(xtrain)[1]
# ╔═╡ 26e99f90-0c3f-11eb-2969-6904bfc99a68
initialize_model(n_inputs, hiddens)
# ╔═╡ 45886582-0c17-11eb-0eab-df58c9a59f19
begin
p, summary = train_and_evaluate!((xtrain, ytrain),
(xtest, ytest),
η,
bs,
n_epochs,
(n_inputs,hiddens))
md"""
$summary
$p
"""
end
# ╔═╡ 344536dc-e8f9-47d0-90fb-b0b2e202a062
tip(md"""
**Use the cell above to toggle between the datasets e.g. "blob" or "circle", or "moon"**
""")
# ╔═╡ 168e1475-241e-4d0a-8af5-c4d0922dc93a
# ╔═╡ c7dca480-0c38-11eb-1b4c-492dbb1c40df
md"""
## 4. Hyperparameter Tuning
The previous step was helpful to gain intuition on the problem and on the effect of the hyperparameters. However such procedure is time consuming and could be automated.
In this section you will implement an automated hyperparameter search.
"""
# ╔═╡ 1ece3390-0c4c-11eb-2f03-99fb824674ae
question(md"""**Exercise:** Implement a random search algorithm and plot the performance in function of the hyperparameters""")
# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7"
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[compat]
Flux = "~0.13.6"
MLJ = "~0.18.5"
MLJBase = "~0.20.19"
Plots = "~1.33.0"
PlutoUI = "~0.7.43"
"""
# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised
julia_version = "1.8.1"
manifest_format = "2.0"
project_hash = "550346d53fd624e61e445448ee86879e218139c2"
[[deps.ARFFFiles]]
deps = ["CategoricalArrays", "Dates", "Parsers", "Tables"]
git-tree-sha1 = "e8c8e0a2be6eb4f56b1672e46004463033daa409"
uuid = "da404889-ca92-49ff-9e8b-0aa6b4d38dc8"
version = "1.4.1"
[[deps.AbstractFFTs]]
deps = ["ChainRulesCore", "LinearAlgebra"]
git-tree-sha1 = "69f7020bd72f069c219b5e8c236c1fa90d2cb409"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
version = "1.2.1"
[[deps.AbstractPlutoDingetjes]]
deps = ["Pkg"]
git-tree-sha1 = "8eaf9f1b4921132a4cff3f36a1d9ba923b14a481"
uuid = "6e696c72-6542-2067-7265-42206c756150"
version = "1.1.4"
[[deps.Adapt]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "195c5505521008abea5aee4f96930717958eac6f"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "3.4.0"
[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
version = "1.1.1"
[[deps.ArrayInterface]]
deps = ["ArrayInterfaceCore", "Compat", "IfElse", "LinearAlgebra", "Static"]
git-tree-sha1 = "d6173480145eb632d6571c148d94b9d3d773820e"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "6.0.23"
[[deps.ArrayInterfaceCore]]
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"]
git-tree-sha1 = "5bb0f8292405a516880a3809954cb832ae7a31c5"
uuid = "30b0a656-2188-435a-8636-2ec0e6a096e2"
version = "0.1.20"
[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
[[deps.BFloat16s]]
deps = ["LinearAlgebra", "Printf", "Random", "Test"]
git-tree-sha1 = "a598ecb0d717092b5539dbbe890c98bac842b072"
uuid = "ab4f0b2a-ad5b-11e8-123f-65d77653426b"
version = "0.2.0"
[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[deps.BitFlags]]
git-tree-sha1 = "84259bb6172806304b9101094a7cc4bc6f56dbc6"
uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35"
version = "0.1.5"
[[deps.Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "19a35467a82e236ff51bc17a3a44b69ef35185a2"
uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
version = "1.0.8+0"
[[deps.CEnum]]
git-tree-sha1 = "eb4cb44a499229b3b8426dcfb5dd85333951ff90"
uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82"
version = "0.4.2"
[[deps.CUDA]]
deps = ["AbstractFFTs", "Adapt", "BFloat16s", "CEnum", "CompilerSupportLibraries_jll", "ExprTools", "GPUArrays", "GPUCompiler", "LLVM", "LazyArtifacts", "Libdl", "LinearAlgebra", "Logging", "Printf", "Random", "Random123", "RandomNumbers", "Reexport", "Requires", "SparseArrays", "SpecialFunctions", "TimerOutputs"]
git-tree-sha1 = "49549e2c28ffb9cc77b3689dc10e46e6271e9452"
uuid = "052768ef-5323-5732-b1bb-66c8b64840ba"
version = "3.12.0"
[[deps.Cairo_jll]]
deps = ["Artifacts", "Bzip2_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "4b859a208b2397a7a623a03449e4636bdb17bcf2"
uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a"
version = "1.16.1+1"
[[deps.Calculus]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad"
uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
version = "0.5.1"
[[deps.CategoricalArrays]]
deps = ["DataAPI", "Future", "Missings", "Printf", "Requires", "Statistics", "Unicode"]
git-tree-sha1 = "5f5a975d996026a8dd877c35fe26a7b8179c02ba"
uuid = "324d7699-5711-5eae-9e2f-1d82baa6b597"
version = "0.10.6"
[[deps.CategoricalDistributions]]
deps = ["CategoricalArrays", "Distributions", "Missings", "OrderedCollections", "Random", "ScientificTypes", "UnicodePlots"]
git-tree-sha1 = "23fe4c6668776fedfd3747c545cd0d1a5190eb15"
uuid = "af321ab8-2d2e-40a6-b165-3d674595d28e"
version = "0.1.9"
[[deps.ChainRules]]
deps = ["Adapt", "ChainRulesCore", "Compat", "Distributed", "GPUArraysCore", "IrrationalConstants", "LinearAlgebra", "Random", "RealDot", "SparseArrays", "Statistics", "StructArrays"]
git-tree-sha1 = "a5fd229d3569a6600ae47abe8cd48cbeb972e173"
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
version = "1.44.6"
[[deps.ChainRulesCore]]
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "e7ff6cadf743c098e08fca25c91103ee4303c9bb"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "1.15.6"
[[deps.ChangesOfVariables]]
deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
git-tree-sha1 = "38f7a08f19d8810338d4f5085211c7dfa5d5bdd8"
uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
version = "0.1.4"
[[deps.CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"]
git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da"
uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
version = "0.7.0"
[[deps.ColorSchemes]]
deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Random"]
git-tree-sha1 = "1fd869cc3875b57347f7027521f561cf46d1fcd8"
uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
version = "3.19.0"
[[deps.ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "eb7f0f8307f71fac7c606984ea5fb2817275d6e4"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.11.4"
[[deps.ColorVectorSpace]]
deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "SpecialFunctions", "Statistics", "TensorCore"]
git-tree-sha1 = "d08c20eef1f2cbc6e60fd3612ac4340b89fea322"
uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4"
version = "0.9.9"
[[deps.Colors]]
deps = ["ColorTypes", "FixedPointNumbers", "Reexport"]
git-tree-sha1 = "417b0ed7b8b838aa6ca0a87aadf1bb9eb111ce40"
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
version = "0.12.8"
[[deps.Combinatorics]]
git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860"
uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
version = "1.0.2"
[[deps.CommonSubexpressions]]
deps = ["MacroTools", "Test"]
git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7"
uuid = "bbf7d656-a473-5ed7-a52c-81e309532950"
version = "0.3.0"
[[deps.Compat]]
deps = ["Dates", "LinearAlgebra", "UUIDs"]
git-tree-sha1 = "5856d3031cdb1f3b2b6340dfdc66b6d9a149a374"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "4.2.0"
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "0.5.2+0"
[[deps.ComputationalResources]]
git-tree-sha1 = "52cb3ec90e8a8bea0e62e275ba577ad0f74821f7"
uuid = "ed09eef8-17a6-5b46-8889-db040fac31e3"
version = "0.3.2"
[[deps.ConstructionBase]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "fb21ddd70a051d882a1686a5a550990bbe371a95"
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
version = "1.4.1"
[[deps.Contour]]
git-tree-sha1 = "d05d9e7b7aedff4e5b51a029dced05cfb6125781"
uuid = "d38c429a-6771-53c6-b99e-75d170b6e991"
version = "0.6.2"
[[deps.Crayons]]
git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.1.1"
[[deps.DataAPI]]
git-tree-sha1 = "1106fa7e1256b402a86a8e7b15c00c85036fef49"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.11.0"
[[deps.DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.13"
[[deps.DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"
[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
[[deps.DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
[[deps.DensityInterface]]
deps = ["InverseFunctions", "Test"]
git-tree-sha1 = "80c3e8639e3353e5d2912fb3a1916b8455e2494b"
uuid = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
version = "0.4.0"
[[deps.DiffResults]]
deps = ["StaticArraysCore"]
git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621"
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
version = "1.1.0"
[[deps.DiffRules]]
deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"]
git-tree-sha1 = "992a23afdb109d0d2f8802a30cf5ae4b1fe7ea68"
uuid = "b552c78f-8df3-52c6-915a-8e097449b14b"
version = "1.11.1"
[[deps.Distances]]
deps = ["LinearAlgebra", "SparseArrays", "Statistics", "StatsAPI"]
git-tree-sha1 = "3258d0659f812acde79e8a74b11f17ac06d0ca04"
uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
version = "0.10.7"
[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[deps.Distributions]]
deps = ["ChainRulesCore", "DensityInterface", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "Test"]
git-tree-sha1 = "70e9677e1195e7236763042194e3fbf147fdb146"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.25.74"
[[deps.DocStringExtensions]]
deps = ["LibGit2"]
git-tree-sha1 = "5158c2b41018c5f7eb1470d558127ac274eca0c9"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.9.1"
[[deps.Downloads]]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
version = "1.6.0"
[[deps.DualNumbers]]
deps = ["Calculus", "NaNMath", "SpecialFunctions"]
git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566"
uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
version = "0.6.8"
[[deps.EarCut_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "e3290f2d49e661fbd94046d7e3726ffcb2d41053"
uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5"
version = "2.2.4+0"
[[deps.EarlyStopping]]
deps = ["Dates", "Statistics"]
git-tree-sha1 = "98fdf08b707aaf69f524a6cd0a67858cefe0cfb6"
uuid = "792122b4-ca99-40de-a6bc-6742525f08b6"
version = "0.3.0"
[[deps.Expat_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "bad72f730e9e91c08d9427d5e8db95478a3c323d"
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
version = "2.4.8+0"
[[deps.ExprTools]]
git-tree-sha1 = "56559bbef6ca5ea0c0818fa5c90320398a6fbf8d"
uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
version = "0.1.8"
[[deps.Extents]]
git-tree-sha1 = "5e1e4c53fa39afe63a7d356e30452249365fba99"
uuid = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
version = "0.1.1"
[[deps.FFMPEG]]
deps = ["FFMPEG_jll"]
git-tree-sha1 = "b57e3acbe22f8484b4b5ff66a7499717fe1a9cc8"
uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
version = "0.4.1"
[[deps.FFMPEG_jll]]
deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "Pkg", "Zlib_jll", "libaom_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"]
git-tree-sha1 = "ccd479984c7838684b3ac204b716c89955c76623"
uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5"
version = "4.4.2+0"
[[deps.FileIO]]
deps = ["Pkg", "Requires", "UUIDs"]
git-tree-sha1 = "94f5101b96d2d968ace56f7f2db19d0a5f592e28"
uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
version = "1.15.0"
[[deps.FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
[[deps.FillArrays]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "Statistics"]
git-tree-sha1 = "87519eb762f85534445f5cda35be12e32759ee14"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "0.13.4"
[[deps.FixedPointNumbers]]
deps = ["Statistics"]
git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc"
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
version = "0.8.4"
[[deps.Flux]]
deps = ["Adapt", "ArrayInterface", "CUDA", "ChainRulesCore", "Functors", "LinearAlgebra", "MLUtils", "MacroTools", "NNlib", "NNlibCUDA", "OneHotArrays", "Optimisers", "ProgressLogging", "Random", "Reexport", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "Test", "Zygote"]
git-tree-sha1 = "76ca02c7c0cb7b8337f7d2d0eadb46ed03c1e843"
uuid = "587475ba-b771-5e3f-ad9e-33799f191a9c"
version = "0.13.6"
[[deps.Fontconfig_jll]]
deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "21efd19106a55620a188615da6d3d06cd7f6ee03"
uuid = "a3f928ae-7b40-5064-980b-68af3947d34b"
version = "2.13.93+0"
[[deps.Formatting]]
deps = ["Printf"]
git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8"
uuid = "59287772-0a20-5a39-b81b-1366585eb4c0"
version = "0.4.2"
[[deps.ForwardDiff]]
deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions", "StaticArrays"]
git-tree-sha1 = "187198a4ed8ccd7b5d99c41b69c679269ea2b2d4"
uuid = "f6369f11-7733-5829-9624-2563aa707210"
version = "0.10.32"
[[deps.FreeType]]
deps = ["CEnum", "FreeType2_jll"]
git-tree-sha1 = "cabd77ab6a6fdff49bfd24af2ebe76e6e018a2b4"
uuid = "b38be410-82b0-50bf-ab77-7b57e271db43"
version = "4.0.0"
[[deps.FreeType2_jll]]
deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"]
git-tree-sha1 = "87eb71354d8ec1a96d4a7636bd57a7347dde3ef9"
uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7"
version = "2.10.4+0"
[[deps.FreeTypeAbstraction]]
deps = ["ColorVectorSpace", "Colors", "FreeType", "GeometryBasics"]
git-tree-sha1 = "38a92e40157100e796690421e34a11c107205c86"
uuid = "663a7486-cb36-511b-a19d-713bb74d65c9"
version = "0.10.0"
[[deps.FriBidi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "aa31987c2ba8704e23c6c8ba8a4f769d5d7e4f91"
uuid = "559328eb-81f9-559d-9380-de523a88c83c"
version = "1.0.10+0"
[[deps.Functors]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "a2657dd0f3e8a61dbe70fc7c122038bd33790af5"
uuid = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
version = "0.3.0"
[[deps.Future]]
deps = ["Random"]
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
[[deps.GLFW_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"]
git-tree-sha1 = "d972031d28c8c8d9d7b41a536ad7bb0c2579caca"
uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89"
version = "3.3.8+0"
[[deps.GPUArrays]]
deps = ["Adapt", "GPUArraysCore", "LLVM", "LinearAlgebra", "Printf", "Random", "Reexport", "Serialization", "Statistics"]
git-tree-sha1 = "45d7deaf05cbb44116ba785d147c518ab46352d7"
uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
version = "8.5.0"
[[deps.GPUArraysCore]]
deps = ["Adapt"]
git-tree-sha1 = "6872f5ec8fd1a38880f027a26739d42dcda6691f"
uuid = "46192b85-c4d5-4398-a991-12ede77f4527"
version = "0.1.2"
[[deps.GPUCompiler]]
deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "TimerOutputs", "UUIDs"]
git-tree-sha1 = "ebb892e1df16040a845e1d11087e4fbfe10323a8"
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
version = "0.16.4"
[[deps.GR]]
deps = ["Base64", "DelimitedFiles", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Pkg", "Printf", "Random", "RelocatableFolders", "Serialization", "Sockets", "Test", "UUIDs"]
git-tree-sha1 = "cf0a9940f250dc3cb6cc6c6821b4bf8a4286cf9c"
uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
version = "0.66.2"
[[deps.GR_jll]]
deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Pkg", "Qt5Base_jll", "Zlib_jll", "libpng_jll"]