Flux.jl icon indicating copy to clipboard operation
Flux.jl copied to clipboard

docs on freezing layers should be ported to the explicit syntax

Open CarloLucibello opened this issue 1 year ago • 3 comments

https://fluxml.ai/Flux.jl/stable/models/advanced/#Freezing-Layer-Parameters should be reworded on the line of https://fluxml.ai/Optimisers.jl/dev/#Frozen-Parameters

CarloLucibello avatar Mar 20 '23 10:03 CarloLucibello

Hi! i added some changes on the docs. Here's the PR: https://github.com/FluxML/Optimisers.jl/pull/133

ghost avatar Mar 23 '23 11:03 ghost

That file is a bit of a random grab-bag of things, I wonder how useful it is to anyone? It's headed "Customised Layers" and maybe there could be a nice description of how & why to make layers, somewhere.

Besides that, it mentions feezing, and links to the description at http://fluxml.ai/Flux.jl/stable/training/training/#Freezing-and-Schedules Maybe that section can just be deleted?

And it mentions trainable, which is a better fit (as it permanently customises layer definitions). This has a docstring at http://fluxml.ai/Flux.jl/stable/destructure/#Optimisers.trainable but isn't described elsewhere.

mcabbott avatar Mar 23 '23 14:03 mcabbott

Re freezing, one thing you might be tempted to use freeze! for is roughly transfer learning: Fixing all but the last few layers, to train only those. That will work but is quite inefficient (and the old Params equivalent was too). What you should do is only differentiate part of the model, something like this: https://github.com/FluxML/model-zoo/blob/master/tutorials/transfer_learning/transfer_learning.jl#L117-L120

We don't say that in the docs anywhere right now. And guessing it requires quite a bit of understanding of how Zygote works. So perhaps we should... but where I don't know.

mcabbott avatar Mar 23 '23 14:03 mcabbott