model-zoo icon indicating copy to clipboard operation
model-zoo copied to clipboard

How about we don't use actively terrible julia code as a common demo?

Open oxinabox opened this issue 5 years ago • 3 comments
trafficstars

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.

oxinabox avatar Feb 14 '20 18:02 oxinabox

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.

tk3369 avatar Feb 14 '20 20:02 tk3369

People do. E.g, i see very similar code is now in: https://github.com/PhilipVinc/TensorBoardLogger.jl/pull/60

oxinabox avatar Feb 14 '20 20:02 oxinabox

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.

jamblejoe avatar Mar 26 '20 00:03 jamblejoe