You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/11/03 00:02:00 UTC

[GitHub] leleamol commented on issue #12966: Strange behaviour/possible bug with mxnet::cpp::Symbol::Variable name argument

leleamol commented on issue #12966: Strange behaviour/possible bug with mxnet::cpp::Symbol::Variable name argument
URL: https://github.com/apache/incubator-mxnet/issues/12966#issuecomment-435542458
 
 
   @nikudyshko The following lines in symbol.hpp are causing this behavior.
   https://github.com/apache/incubator-mxnet/blob/e33da520641489363a710752e4fa7245a84aaa68/cpp-package/include/mxnet-cpp/symbol.hpp#L277
   
   If the names of "weight" and "bias" variables are not 3 or 4 character long, then gradients for these variables are not upgraded. Hence the training fails. We need to fix this issue.
   
   However, this can be worked around either by having the names of these variables more than 4 character long. Or passing the "std::map<std::string, OpReqType>" to Symbol::SimpleBind() function.
   The std::map<std::string, OpReqType> map contains the symbol names for which we would like to update the gradients. Entries in this map will be
   
   ```
   std::map<std::string, OpReqType> grad_req_type;
   
   // ws1, bs1, ws2, bs2 are the names of weights and bias variables for layer 1 and 2
   grad_req_type["ws1"] = OpReqType::kWriteTo
   grad_req_type["bs1"] = OpReqType::kWriteTo
   grad_req_type["ws2"] = OpReqType::kWriteTo
   grad_req_type["bs2"] = OpReqType::kWriteTo
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services