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/02 07:52:38 UTC

[GitHub] aravindhv10 opened a new issue #13087: softmax in symbol api

aravindhv10 opened a new issue #13087: softmax in symbol api
URL: https://github.com/apache/incubator-mxnet/issues/13087
 
 
   Hello,
   
        I want to have softmax activation with linear regression output, I was able to get this in gluon in the following way:
   
   class CenteredLayer(mx.gluon.nn.HybridSequential):
       def __init__(self, **kwargs):
           super(CenteredLayer, self).__init__(**kwargs)
   
       def forward(self, x):
           return x.softmax()
   
   net = gluon.nn.HybridSequential()
   with net.name_scope():
       net.add ( gluon.nn.Dense ( sizes[1] , activation="relu" ) )
       net.add ( gluon.nn.Dense ( sizes[2] , activation="relu" ) )
       net.add ( gluon.nn.Dense ( sizes[3] , activation="relu" ) )
       net.add ( gluon.nn.Dense ( sizes[4] , activation="relu" ) )
       net.add ( gluon.nn.Dense ( sizes[5] , activation="relu" ) )
       net.add ( gluon.nn.Dense ( sizes[4] , activation="relu" ) )
       net.add ( gluon.nn.Dense ( sizes[3] , activation="relu" ) )
       net.add ( gluon.nn.Dense ( sizes[2] , activation="relu" ) )
       net.add ( gluon.nn.Dense ( sizes[1] , activation="relu" ) )
       net.add ( gluon.nn.Dense ( sizes[0] , activation="relu" ) )
       net.add ( gluon.nn.Dense ( sizes[0]                     ) )
       net.add ( CenteredLayer()                                 )
   
   But now I want to get this in the symbol c++ api, I donot want the cross entropy softmax output but only softmax activation with 

----------------------------------------------------------------
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