-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Migrate dl code from webscaleml to spark-dl #2
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
Conversation
|
When defining a model, instead of directly calling the constructors of individual modules, we should use factory methods (e.g., through Scala companion object’s apply methods). This allows one to define the same model that can run using different underlying engine (e.g., MKL-DNN). |
|
Let me create a issue to log this. |
|
Please remove |
| var error = nextError | ||
| while (i > 0) { | ||
| val input = modules(i - 1).output | ||
| error = modules(i).backward(input, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we call each module's updateGradInput here? And then we also need to implement the updateGradInput method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some special case, some module will override backward instead of updateGradInput, to do something beyond updateGradInput and accGrad(for most modules, these two operations are enough in backward).
So the container call backward.
* add github action for nano code style (#1) * Update nano-style-check.yml * Test pr (#2) * change something * make style break * Update nano-style-check.yml * Update nano-style-check.yml (#3) * Update nano-style-check.yml * Update nano-style-check.yml * Update nano-style-check.yml * Update nano-style-check.yml * Update nano-style-check.yml * Update nano-style-check.yml * fix style * change nane
No description provided.