This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
softmax in symbol api #13087
Unanswered
aravindhv10
asked this question in
Q&A
Replies: 3 comments
-
Hello,
to get softmax of each data point (this is a 40 dimensional array) in a batch size of 256, I use softmax(axis=1) so this implemented as: auto Sm = Operator("softmax")
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello again, the above solution is not working as the network is not learning at all. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@mxnet-label-bot [Gluon, Question] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
class CenteredLayer(mx.gluon.nn.HybridSequential):
def init(self, **kwargs):
super(CenteredLayer, self).init(**kwargs)
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() )
softmax_cross_entropy = gluon.loss.L2Loss()
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 linear regression L2 loss. I was unable to find the softmax operator, is there any documentation for this ?
The c snippet is :
auto input_data = Symbol::Variable ( "data" ) ;
auto target_label = Symbol::Variable ( "data_label" ) ;
Thanks in advance, I can add any more information if required.
Beta Was this translation helpful? Give feedback.
All reactions