-
-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A more type focused interface #19
Comments
Yes, great to have this discussion here, thanks for opening. I agree completely about the black-boxy-ness of Currently RE backends. The code eval stuff is really only a lazy-loading technique; if we simply included the backend files it would behave the same but force a dependency on both backend libs, which is unreasonable for the user. But it's not a great long-term solution; better might be to have backends be separate packages that are explicitly loaded, which would obviate all the eval stuff. That aside,
Can you elaborate on this question? |
I think that would help clarify things a lot. If I have time I'll try and work through some of the examples in the docs without
Yeah, I've also had issues with wanting lazy loading in julia. I know packages like Extern.jl aim to address this in a more general way by placing your code in a macro block without changing it, but it's essentially doing the same thing.
I mostly just thought that
Sorry, I was just referring to the docs where it says
but it doesn't really explain how |
This is an interesting use case I hadn't thought about as much. Still though, I think it works out the same either way; you can think of the global backend = compiletf
# later on
backend(mymodel) One thing I could see coming up, though, is that we might want to provide a vocabulary over backends beyond
Ah ok, so this is just unclear writing on my part. function h(x)
temp = f(x)
return temp, g(temp)
end This is all I meant by reusing outputs; storing and reusing the output of It's possible to create more function combinators that can express this kind of logic, but much more intuitive to just write it out with normal Julia syntax; that's the power of |
I've just reworked the docs along these lines, so hopefully it should be easier to follow. I also added some internal docs, and you can check out how I've made the test code generic across backends here. I'll close this for now, hopefully that clears some things up, but please do let me know if anything else needs clarifying – or any other feedback is welcome. |
HI,
Flux looks really cool and I like the simplicity of the API. I'm not sure if this is the right platform for this discussion, but it would be nice if some of the magic parts of Flux were a little easier to follow. I think it would help if there were fewer macros and better use of types and multiple dispatch. Some examples include:
@net
to only providing syntactic sugar rather including other behaviour that isn't clearly explained in the docs (e.g., is there an easy way to reuse outputs more than once outside of the@net
syntax?). More explicit use of the model type hierarchy would help as, at least in the documentation, it is unclear that@net
is also subtypingFlex.Model
.I'm still reading through the code, so I apologize if I'm missing some of the requirements that necessitate the heavy use of macros and code evaluation.
The text was updated successfully, but these errors were encountered: