I want to implement l1 regularization with symbol APIs, and I am struggled with the collecting of all the parameters.
I can use out.list_arguments() to get all the trainable arguments, but
list_arguments() only list their name, rather than python symbols. Here comes my question.
It is quite easily create a new symbol by
import mxnet as mx foo=mx.sym.var('bar')
Here, we create a python variable names
foo, but its name in mxnet is
I want to know can we use
'bar' rather than
Seems difficult since we have:
f0=mx.sym.var('bar',shape=(3,3)) f1=mx.sym.var('bar',shape=(2,2)) >>> f0.infer_shape() ([(3, 3)], [(3, 3)], )
Further more, I don’t know if it is polite to ask another question in this thread, but I really want to know if there exists a better way to perform mx.*.dot between
If we already knows some ‘ground truth’, we may come up with a constant matrix (
mx.nd.array), but the data is unkonwn (
mx.sym.var). If we want to preform a
dot op, what ever we use(mx.nd.dot/mx.sym.dot), mxnet will raise an exception.
I finally came up with two solutions, one of them is
and another is
TTx=mx.sym.var('TT',shape=TT.shape)#model should provide the value of STx,YTx,TTx
I don’t know if there is a better way to achieve the goal.