Skip to content

Conversation

@oxinabox
Copy link
Member

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.

@tk3369
Copy link

tk3369 commented Feb 14, 2020

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.

@oxinabox
Copy link
Member Author

People do.
E.g, i see very similar code is now in:
JuliaLogging/TensorBoardLogger.jl#60

@jamblejoe
Copy link

This was suggested for the examples in Flux.jl as well, see FluxML/Flux.jl#1085.
I find it easiest to suround critical parts in let ... end blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants