I recently opened an issue on Flux as there is something that needs clarification I think about using Flux with Julia’s functions.
To summarize my issue: I have a project where I have various equations embedded in functions. Here is an example notebook with a toy problem looking like my research problem.
I saw that most functions used with Flux code are functions that call global variables/Flux structures. However, to work well in my case (particularly when using different scripts or looping between different networks and hence avoiding ambiguity), I directly provide the Flux models as an argument to my functions. This is nice but a potential downside is that this forces me to also provide the network in the dataset list during training… See the notebook for a (quickly written and probably messy) example.
My question is related to the later point: Is this a legit way of doing things, or is there a better way to provide models to functions?
Also, I wonder if this may have any influence on training speed?
Thanks in advance for any insights!