Is it possible to set an attribute in some layers from the symbol?
I tried the following and it doesn’t work:
model_attr = model_symbol.attr_dict()
model_attr['conv_1_weight']['lr_mult'] = 0.01
This doesn’t work because the attr dict returned is a copy from the symbol. Is it possible to somehow change the parameters of certain layers from one place instead of going to the layer definitions and adding the attribute there?
i.e., I want to avoid doing this in all the layers:
c1 = mx.sym.Convolution(data, kernel=(3,3), num_filter=16, name="conv_1", attr={"lr_mult": "0.01"})
Edit: I have also tried the following
model_symbol = model_symbol_group[0] # since I have a symbol group
model_attr = model_symbol.attr_dict()
model_attr['conv_1_weight']['lr_mult'] = 0.01
model_attr['conv_1_weight']['__lr_mult__'] = 0.01
model_symbol._set_attr(**model_attr['conv_1_weight'])
I got the last call from https://mxnet.incubator.apache.org/_modules/mxnet/symbol/symbol.html
This also isn’t working. I get no errors on _set_attr but when I try to view the attr dict again, it doesn’t have the changes.