Skip to content

Commit 1bc88a6

Browse files
committed
update docs notebooks
1 parent cfa95cc commit 1bc88a6

File tree

8 files changed

+551
-224
lines changed

8 files changed

+551
-224
lines changed

Manifest.toml

+7-9
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,9 @@ version = "1.6.0"
228228

229229
[[DataAugmentation]]
230230
deps = ["ColorBlendModes", "CoordinateTransformations", "ImageDraw", "ImageTransformations", "Images", "Interpolations", "LinearAlgebra", "Parameters", "Rotations", "Setfield", "StaticArrays", "Statistics"]
231-
git-tree-sha1 = "2e9b277d0e5458c84e0c310cdfb2d591901dda4e"
232-
repo-rev = "master"
233-
repo-url = "https://github.com/lorenzoh/DataAugmentation.jl"
231+
git-tree-sha1 = "8138afd39eb19c8b47e094fb7a18fb8f752cc3b3"
234232
uuid = "88a5189c-e7ff-4f85-ac6b-e6158070f02e"
235-
version = "0.1.0"
233+
version = "0.1.1"
236234

237235
[[DataDeps]]
238236
deps = ["BinaryProvider", "HTTP", "Libdl", "Reexport", "SHA", "p7zip_jll"]
@@ -527,9 +525,9 @@ version = "0.8.20"
527525

528526
[[ImageDistances]]
529527
deps = ["ColorVectorSpace", "Distances", "ImageCore", "ImageMorphology", "LinearAlgebra", "Statistics"]
530-
git-tree-sha1 = "159e24b4313d9197eef900e97fbd7365986f2844"
528+
git-tree-sha1 = "622fdcb6ec80aee6f6620f3788ea269702a24545"
531529
uuid = "51556ac3-7006-55f5-8cb3-34580c88182d"
532-
version = "0.2.10"
530+
version = "0.2.11"
533531

534532
[[ImageDraw]]
535533
deps = ["Distances", "ImageCore", "LinearAlgebra"]
@@ -538,10 +536,10 @@ uuid = "4381153b-2b60-58ae-a1ba-fd683676385f"
538536
version = "0.2.4"
539537

540538
[[ImageFiltering]]
541-
deps = ["CatIndices", "ColorVectorSpace", "ComputationalResources", "DataStructures", "FFTViews", "FFTW", "ImageCore", "ImageMetadata", "LinearAlgebra", "OffsetArrays", "Requires", "SparseArrays", "StaticArrays", "Statistics", "TiledIteration"]
542-
git-tree-sha1 = "f82a52fa2e684d4ed69028b16188852ff94b3f75"
539+
deps = ["CatIndices", "ColorVectorSpace", "ComputationalResources", "DataStructures", "FFTViews", "FFTW", "ImageCore", "LinearAlgebra", "OffsetArrays", "Requires", "SparseArrays", "StaticArrays", "Statistics", "TiledIteration"]
540+
git-tree-sha1 = "81b493f57c67a8dff822e43cb2abefece7b52131"
543541
uuid = "6a3955dd-da59-5b1f-98d4-e7296123deb5"
544-
version = "0.6.19"
542+
version = "0.6.20"
545543

546544
[[ImageIO]]
547545
deps = ["FileIO", "Netpbm", "PNGFiles"]

docs/make.jl

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ download_artifact(
1111
)
1212

1313
Publish.Themes.default() = artifact"flux-theme"
14+
ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
1415

1516
p = Publish.Project(FastAI)
1617

docs/notebooks/imageclassification.ipynb docs/notebooks/finetune.ipynb

+44-28
Large diffs are not rendered by default.

docs/notebooks/fitonecycle.ipynb

+94-85
Large diffs are not rendered by default.

docs/notebooks/lrfind.ipynb

+373-101
Large diffs are not rendered by default.

docs/setup.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@ FastAI.jl is not registered yet since it depends on some unregistered packages (
66
] clone https://github.com/lorenzoh/FastAI.jl
77
] activate FastAI
88
] instantiate
9+
```
10+
11+
FastAI.jl also defines [Makie.jl] plotting recipes to visualize data. If you want to use them, you'll have to install and one of the Makie.jl backends [CairoMakie.jl](https://github.com/JuliaPlots/CairoMakie.jl), [GLMakie.jl](https://github.com/JuliaPlots/GLMakie.jl) or [WGLMakie.jl](https://github.com/JuliaPlots/WGLMakie.jl). For example:
12+
13+
```julia
14+
] add CairoMakie
915
```

src/training/lrfind.jl

+25
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,28 @@ function FluxTraining.fitepochphase!(
7373

7474
phase.result = LRFinderResult(losses, lrs)
7575
end
76+
77+
78+
79+
function plotlrfind(lrs, losses)
80+
f = Figure(resolution = (700, 400))
81+
f[1, 1] = ax = Axis(f)
82+
83+
xtickvalues = (10.) .^(-10:10)
84+
ax.xlabel = "Learning rate"
85+
ax.xticks = log.(xtickvalues)
86+
ax.xtickformat[] = vals -> string.(xtickvalues)
87+
ax.xticklabelsize = 10.
88+
89+
ax.ylabel = "Loss"
90+
ax.yticks = []
91+
ax.ytickformat[] = vals -> string.(log.(vals))
92+
ax.yticklabelsize = 10.
93+
94+
95+
AbstractPlotting.lines!(ax, log.(lrs), log.(losses), axis = (xticks = LinearTicks(10),))
96+
return f
97+
end
98+
99+
plotlrfind(phase::LRFinderPhase) = plotlrfind(phase.result)
100+
plotlrfind(lrresult::LRFinderResult) = plotlrfind(lrresult.lrs, lrresult.losses)

toc.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# How To
1717

1818
- [Train a model from scratch](docs/notebooks/fitonecycle.ipynb)
19-
- [Finetune a pretrained model](docs/notebooks/fitonecycle.ipynb)
19+
- [Finetune a pretrained model](docs/notebooks/finetune.ipynb)
2020
- [Find a good learning rate](docs/notebooks/lrfind.ipynb)
2121

2222
# Reference

0 commit comments

Comments
 (0)