You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/08/04 22:31:13 UTC

[GitHub] thirdwing commented on issue #7219: [R] How to include a minimum function in MakeLoss

thirdwing commented on issue #7219: [R] How to include a minimum function in MakeLoss
URL: https://github.com/apache/incubator-mxnet/issues/7219#issuecomment-320367128
 
 
   @solalm Can you try the code below. I am sorry that the function isn't exported correctly.
   
   ```r
   library(mxnet)
   
   label <- mx.symbol.Variable("label")
   
   data <- mx.symbol.Variable("data")
   fc1 <- mx.symbol.FullyConnected(data, name = "fc1", num_hidden = 8)
   relu1 <- mx.symbol.Activation(fc1, name = "relu1", act_type = "relu")
   fc2 <- mx.symbol.FullyConnected(relu1, name = "fc2", num_hidden = 4)
   relu2 <- mx.symbol.Activation(fc2, name = "relu2", act_type = "relu")
   fc3 <- mx.symbol.FullyConnected(relu2, name = "fc3", num_hidden = 1)
   fc_abs <- mx.symbol.abs(mx.symbol.Reshape(fc3, shape = 0) - label)
   
   lro2 <- mxnet:::mx.varg.symbol.internal.MinimumScalar(list(fc_abs, scalar = 1))
   ```
 
----------------------------------------------------------------
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