class ModelParam: train_symbol = train_sym test_symbol = test_sym rpn_test_symbol = rpn_test_sym from_scratch = False random = True memonger = False memonger_until = "stage3_unit21_plus" process_weight = lambda sym, arg, aux: \ add_anchor_to_arg( sym, arg, aux, RpnParam.anchor_generate.max_side, RpnParam.anchor_generate.stride,RpnParam.anchor_generate.scale, RpnParam.anchor_generate.ratio) class pretrain: prefix = "pretrain_model/resnet%s_v1b" % BackboneParam.depth epoch = 0 fixed_param = ["conv0", "stage1", "gamma", "beta"] class QuantizeTrainingParam: quantize_flag = False # quantized_op = ("Convolution", "FullyConnected", "Deconvolution","Concat", "Pooling", "add_n", "elemwise_add") quantized_op = ("Convolution", "FullyConnected", "Deconvolution") class WeightQuantizeParam: delay_quant = 0 ema_decay = 0.99 grad_mode = "ste" is_weight = True is_weight_perchannel = False quant_mode = "minmax" class ActQuantizeParam: delay_quant = 0 ema_decay = 0.99 grad_mode = "ste" is_weight = False is_weight_perchannel = False quant_mode = "minmax"
def process_weight(sym, arg, aux): for stride in RpnParam.anchor_generate.stride: add_anchor_to_arg(sym, arg, aux, RpnParam.anchor_generate.max_side, stride, RpnParam.anchor_generate.scale, RpnParam.anchor_generate.ratio)