These functional API advantages seem like they could also be implemented in a sub-classing style (though they haven’t been yet.) Classes are perfectly capable of holding/serializing/being reconstructed from data structures, including graphs and input shapes. What am I missing?https://twitter.com/fchollet/status/1414667159326715908 …
-
-
Replying to @karlhigley
You mean, implementing a one-off version of the Functional Model class every time you make a new model? Doesn't seem very scalable. If your model is defined in the body of the `call` method, then it's made of bytecode. Turning it into an actual graph will require extra work.
2 replies 0 retweets 1 like -
Replying to @fchollet
Well, no, I mean that in concept at least, a base class that provides functionality for building layers up into graphs that isn’t defined in the `call` method (even if it runs there) seems possible.
1 reply 0 retweets 0 likes -
Replying to @karlhigley @fchollet
And building up a serializable data structure like a graph of layers doesn’t seem to have an inherent relationship with either functional or sub-classing *styles* (even if it is currently substantially easier to do with one API than the other.)
1 reply 0 retweets 0 likes -
Replying to @karlhigley @fchollet
I mean, maybe I’m wrong here and there is a dependency I’m not thinking of. I’m just trying to peel apart how much the current advantages of the functional API are inherent to the style and how much they’re just a reflection of the current state of the world (which could change.)
1 reply 0 retweets 0 likes -
Replying to @karlhigley @fchollet
Personally, I like the sub-classing style, but the advantages you cited of the functional API are real and important, so I’m thinking about what it would look like if the sub-classing style had them too.
1 reply 0 retweets 0 likes -
Replying to @karlhigley
I see, I think you may be thinking of the following style -- basically a Functional model, but defined by subclassing the `Model` class (which is useful for packaging and for adding/overriding methods, like `train_step`/ etcpic.twitter.com/dG7XxxtCo8
2 replies 0 retweets 3 likes
But if you want to decouple these extra methods from the model-definition style, you can also just do this:pic.twitter.com/M9QerkFCJ0
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.