}, ]), 'weight_decay_rate': 0.0001, } NETWORK = SmartDict() NETWORK.OPTIMIZER_CLASS = None NETWORK.OPTIMIZER_KWARGS = {} NETWORK.LEARNING_RATE_FUNC = None NETWORK.LEARNING_RATE_KWARGS = {} NETWORK.WEIGHT_DECAY_RATE = None NETWORK.IMAGE_SIZE = IMAGE_SIZE NETWORK.BATCH_SIZE = BATCH_SIZE NETWORK.DATA_FORMAT = DATA_FORMAT NETWORK.ACTIVATION_QUANTIZER = linear_mid_tread_half_quantizer NETWORK.ACTIVATION_QUANTIZER_KWARGS = {'bit': 2, 'max_value': 2} NETWORK.WEIGHT_QUANTIZER = binary_mean_scaling_quantizer NETWORK.WEIGHT_QUANTIZER_KWARGS = {} # dataset DATASET = SmartDict() DATASET.BATCH_SIZE = BATCH_SIZE DATASET.DATA_FORMAT = DATA_FORMAT DATASET.PRE_PROCESSOR = PRE_PROCESSOR DATASET.AUGMENTOR = Sequence([ Pad(2), Crop(size=IMAGE_SIZE), FlipLeftRight(), ])
NETWORK.CLASS_SCALE = 1.0 NETWORK.COORDINATE_SCALE = 1.0 NETWORK.LOSS_IOU_THRESHOLD = 0.6 NETWORK.WEIGHT_DECAY_RATE = 0.0005 NETWORK.SCORE_THRESHOLD = score_threshold NETWORK.NMS_IOU_THRESHOLD = nms_iou_threshold NETWORK.NMS_MAX_OUTPUT_SIZE = nms_max_output_size NETWORK.LOSS_WARMUP_STEPS = 1280 // BATCH_SIZE # quantization NETWORK.ACTIVATION_QUANTIZER = linear_mid_tread_half_quantizer NETWORK.ACTIVATION_QUANTIZER_KWARGS = {'bit': 2, 'max_value': 2.0} NETWORK.WEIGHT_QUANTIZER = binary_channel_wise_mean_scaling_quantizer NETWORK.WEIGHT_QUANTIZER_KWARGS = {} NETWORK.QUANTIZE_FIRST_CONVOLUTION = True NETWORK.QUANTIZE_LAST_CONVOLUTION = False # dataset DATASET = SmartDict() DATASET.BATCH_SIZE = BATCH_SIZE DATASET.DATA_FORMAT = DATA_FORMAT DATASET.PRE_PROCESSOR = PRE_PROCESSOR DATASET.AUGMENTOR = Sequence([ FlipLeftRight(), Brightness((0.75, 1.25)), Color((0.75, 1.25)), Contrast((0.75, 1.25)), Hue((-10, 10)), SSDRandomCrop(min_crop_ratio=0.7), ])
NETWORK.OPTIMIZER_KWARGS = {"learning_rate": 0.001} NETWORK.IMAGE_SIZE = IMAGE_SIZE NETWORK.BATCH_SIZE = BATCH_SIZE NETWORK.DATA_FORMAT = DATA_FORMAT NETWORK.WEIGHT_DECAY_RATE = 0. NETWORK.AUXILIARY_LOSS_WEIGHT = 0.5 NETWORK.USE_FEATURE_FUSION = True NETWORK.USE_ATTENTION_REFINEMENT = True NETWORK.USE_TAIL_GAP = True NETWORK.ACTIVATION_QUANTIZER = linear_mid_tread_half_quantizer NETWORK.ACTIVATION_QUANTIZER_KWARGS = { 'bit': 2, 'max_value': 2 } NETWORK.WEIGHT_QUANTIZER = binary_channel_wise_mean_scaling_quantizer NETWORK.WEIGHT_QUANTIZER_KWARGS = {} DATASET = SmartDict() DATASET.BATCH_SIZE = BATCH_SIZE DATASET.DATA_FORMAT = DATA_FORMAT DATASET.PRE_PROCESSOR = PRE_PROCESSOR DATASET.AUGMENTOR = Sequence([ Resize(size=IMAGE_SIZE), Brightness((0.75, 1.25)), Color((0.75, 1.25)), Contrast((0.75, 1.25)), FlipLeftRight(), Hue((-10, 10)), ]) DATASET.ENABLE_PREFETCH = True
# for debug # BATCH_SIZE = 2 # SUMMARISE_STEPS = 1 # IS_DEBUG = True PRE_PROCESSOR = Sequence([ Resize(size=IMAGE_SIZE), DivideBy255(), ]) POST_PROCESSOR = None NETWORK = SmartDict() NETWORK.OPTIMIZER_CLASS = tf.compat.v1.train.AdamOptimizer NETWORK.OPTIMIZER_KWARGS = {"learning_rate": 0.001} NETWORK.IMAGE_SIZE = IMAGE_SIZE NETWORK.BATCH_SIZE = BATCH_SIZE NETWORK.DATA_FORMAT = DATA_FORMAT NETWORK.ACTIVATION_QUANTIZER = linear_mid_tread_half_quantizer NETWORK.ACTIVATION_QUANTIZER_KWARGS = {'bit': 2, 'max_value': 2} NETWORK.WEIGHT_QUANTIZER = binary_mean_scaling_quantizer NETWORK.WEIGHT_QUANTIZER_KWARGS = {} DATASET = SmartDict() DATASET.BATCH_SIZE = BATCH_SIZE DATASET.DATA_FORMAT = DATA_FORMAT DATASET.PRE_PROCESSOR = PRE_PROCESSOR DATASET.AUGMENTOR = Sequence([ FlipLeftRight(), ]) DATASET.ENABLE_PREFETCH = True
# for debug # BATCH_SIZE = 2 # SUMMARISE_STEPS = 1 # IS_DEBUG = True PRE_PROCESSOR = Sequence([ PerImageStandardization(), ]) POST_PROCESSOR = None NETWORK = SmartDict() NETWORK.OPTIMIZER_CLASS = tf.compat.v1.train.AdamOptimizer NETWORK.OPTIMIZER_KWARGS = {"learning_rate": 0.001} NETWORK.IMAGE_SIZE = IMAGE_SIZE NETWORK.BATCH_SIZE = BATCH_SIZE NETWORK.DATA_FORMAT = DATA_FORMAT DATASET = SmartDict() DATASET.BATCH_SIZE = BATCH_SIZE DATASET.DATA_FORMAT = DATA_FORMAT DATASET.PRE_PROCESSOR = PRE_PROCESSOR DATASET.AUGMENTOR = Sequence([ Brightness((0.75, 1.25)), Color((0.75, 1.25)), Contrast((0.75, 1.25)), FlipLeftRight(), Hue((-10, 10)), ]) DATASET.ENABLE_PREFETCH = True
Resize(size=IMAGE_SIZE), {% if quantize_first_convolution %}DivideBy255(){% else %}PerImageStandardization(){% endif %} ]) POST_PROCESSOR = None NETWORK = SmartDict() NETWORK.OPTIMIZER_CLASS = {{optimizer_class}} NETWORK.OPTIMIZER_KWARGS = {{optimizer_kwargs}} NETWORK.LEARNING_RATE_FUNC = {{learning_rate_func}} NETWORK.LEARNING_RATE_KWARGS = {{learning_rate_kwargs}} NETWORK.IMAGE_SIZE = IMAGE_SIZE NETWORK.BATCH_SIZE = BATCH_SIZE NETWORK.DATA_FORMAT = DATA_FORMAT NETWORK.ACTIVATION_QUANTIZER = linear_mid_tread_half_quantizer NETWORK.ACTIVATION_QUANTIZER_KWARGS = { 'bit': 2, 'max_value': 2 } NETWORK.WEIGHT_QUANTIZER = binary_mean_scaling_quantizer NETWORK.WEIGHT_QUANTIZER_KWARGS = {} DATASET = SmartDict() DATASET.BATCH_SIZE = BATCH_SIZE DATASET.DATA_FORMAT = DATA_FORMAT DATASET.PRE_PROCESSOR = PRE_PROCESSOR DATASET.AUGMENTOR = Sequence([{% if data_augmentation %}{% for aug_name, aug_val in data_augmentation.items() %} {{ aug_name }}({% for param_name, param_value in aug_val %}{{ param_name }}={{ param_value }}, {% endfor %}),{% endfor %} {% endif %}]) DATASET.ENABLE_PREFETCH = {{ dataset_prefetch }}
NETWORK.OPTIMIZER_CLASS = tf.compat.v1.train.AdamOptimizer NETWORK.OPTIMIZER_KWARGS = {} NETWORK.LEARNING_RATE_FUNC = tf.compat.v1.train.piecewise_constant NETWORK.LEARNING_RATE_KWARGS = { "values": [1e-4, 1e-3, 1e-4, 1e-5], "boundaries": [5000, step_per_epoch * 5, step_per_epoch * 10], } NETWORK.STRIDE = STRIDE NETWORK.IMAGE_SIZE = IMAGE_SIZE NETWORK.BATCH_SIZE = BATCH_SIZE NETWORK.DATA_FORMAT = DATA_FORMAT NETWORK.ACTIVATION_QUANTIZER = linear_mid_tread_half_quantizer NETWORK.ACTIVATION_QUANTIZER_KWARGS = { 'bit': 2, 'max_value': 2 } NETWORK.WEIGHT_QUANTIZER = binary_channel_wise_mean_scaling_quantizer NETWORK.WEIGHT_QUANTIZER_KWARGS = {} DATASET = SmartDict() DATASET.IMAGE_SIZE = IMAGE_SIZE DATASET.BATCH_SIZE = BATCH_SIZE DATASET.DATA_FORMAT = DATA_FORMAT DATASET.PRE_PROCESSOR = PRE_PROCESSOR DATASET.AUGMENTOR = Sequence([ Brightness((0.75, 1.25)), Color((0.75, 1.25)), Contrast((0.75, 1.25)) ]) DATASET.ENABLE_PREFETCH = True