model-zoo
model-zoo copied to clipboard
How about we don't use actively terrible julia code as a common demo?
I fixed it from being the worst by putting it in a function.
Though I wonder if better would have been to fix it with const + making loss(m) = (x,y)->... etc.
I think it's best to promote good practice. I imagine that people would take a template from model zoo and start manipulating it into their own use cases.
People do. E.g, i see very similar code is now in: https://github.com/PhilipVinc/TensorBoardLogger.jl/pull/60
This was suggested for the examples in Flux.jl as well, see https://github.com/FluxML/Flux.jl/pull/1085.
I find it easiest to suround critical parts in let ... end blocks.