问题
I realize I can make my own module/optimizer to do this, but can existing mxnet modules be told to optimize only a subset of variables?
Along those same lines, how does a module determine which symbols to optimize as it is? For example, unlike tensorflow in MXNet, both data and variables to be optimized are just "Variable" symbols, but somehow MXNet only affects the NDArrays for the actual variables and not data NDArrays. How does it check? Is there a naming convention it uses? If so, what is that convention? (Any symbol with a name containing 'data' in it is not optimized?)
回答1:
Although I haven't tested it, looking at the doc and source, I think I have the answer.
In a module constructor, there is a default argument named data_names
that is a list of strings for the names of symbols that are data objects and not to be optimized (similar for labels). Moreover, there is also a default argument named fixed_param_names
which is a list of strings specifying a blacklist of Variables not to be optimized.
来源:https://stackoverflow.com/questions/41705395/how-does-a-module-optimizer-choose-which-symbols-to-optimize