-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace separate SoftmaxOutput constructor parameters with Config struct
This should make it much easier to customize one or two of the softmax config parameters, for example: ```D SoftmaxOutput.Config config = { preserve_shape = true }; auto s = new SoftmaxOutput(input, label, config); ``` A usage example unittest has been added.
- Loading branch information
1 parent
c6da7fd
commit fe344ee
Showing
2 changed files
with
188 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
* `mxnet.Symbol.SoftmaxOutput` | ||
|
||
A new nested `Config` class has been added in order to store the various | ||
optional settings that can be used with this symbol. The constructor has | ||
been rewritten to use an instance of this struct (initialized to default | ||
values) rather than to require each parameter separately. This should | ||
make it easier to instantiate `SoftmaxOutput` instances with only one or | ||
a few custom settings, for example: | ||
|
||
```D | ||
SoftmaxOutput.Config config = { | ||
grad_scale: 1.5, | ||
preserve_shape: true | ||
}; | ||
auto softmax_custom = new SoftmaxOutput(input, label, config); | ||
``` | ||
|
||
The config parameter is entirely optional: instances created using the | ||
default configuration via | ||
|
||
```D | ||
auto softmax_default = new SoftmaxOutput(input, label); | ||
``` | ||
|
||
will behave exactly the same as before. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters