How does a module/optimizer choose which symbols to optimize?

眉间皱痕 提交于 2020-01-07 06:24:26

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!