You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While this works, this opens a lot of possibilities for mistakes from the user side. The user is not forced in any way to define the necessary functions with the necessary parameters (e.g. arch.loss(H, logits, labels), arch.evaluation(H, logits, labels)).
Something similar as Javas interfaces are Abstrace Base Classes (ABCs). However, I don't really see the use of them. If the user does not implement the required functions (which should be well documented, of course), the toolkit will throw an error (telling him that he should implement it).
I can see two minor advantages:
With ABCs, it is clear without much documentation what the user needs to do. From the code. It might also be what people from the Java-world might be looking for.
With ABCs, it is probably easier to find the classes.
So right now the configuration file for a model looks like this:
and then the files are dynamically imported with
While this works, this opens a lot of possibilities for mistakes from the user side. The user is not forced in any way to define the necessary functions with the necessary parameters (e.g.
arch.loss(H, logits, labels)
,arch.evaluation(H, logits, labels)
).My suggestion would be to use something equivalent to Java Interfaces. However, it seems like my suggestion goes against the python philosophy (see http://stackoverflow.com/questions/8181576/java-abstract-interface-design-in-python). So I'm opening this issue for discussion in general.
The text was updated successfully, but these errors were encountered: