Example #1
0
def forecaster_params_mnist():
    return [[
        OrderedDict({
            layer[0]: [layer[1], layer[2], layer[3], layer[4], layer[5]]
            for layer in sub
        }) for sub in cfg.MODEL.FORECASTER.UPSAMPLE
    ],
            [
                TrajGRU(
                    input_channel=cfg.MODEL.FORECASTER.RNN_BLOCKS.NUM_INPUT[i],
                    num_filter=cfg.MODEL.FORECASTER.RNN_BLOCKS.NUM_FILTER[i],
                    b_h_w=(batch_size,
                           cfg.MODEL.FORECASTER.RNN_BLOCKS.HW[i][0],
                           cfg.MODEL.FORECASTER.RNN_BLOCKS.HW[i][1]),
                    zoneout=0.0,
                    L=cfg.MODEL.FORECASTER.RNN_BLOCKS.L[i],
                    i2h_kernel=cfg.MODEL.FORECASTER.RNN_BLOCKS.I2H_KERNEL[i],
                    i2h_stride=cfg.MODEL.FORECASTER.RNN_BLOCKS.I2H_STRIDE[i],
                    i2h_pad=cfg.MODEL.FORECASTER.RNN_BLOCKS.I2H_PAD[i],
                    h2h_kernel=cfg.MODEL.FORECASTER.RNN_BLOCKS.H2H_KERNEL[i],
                    h2h_dilate=cfg.MODEL.FORECASTER.RNN_BLOCKS.H2H_DILATE[i],
                    act_type=activation(cfg.MODEL.RNN_ACT_TYPE,
                                        negative_slope=0.2,
                                        inplace=True))
                for i in range(len(cfg.MODEL.FORECASTER.RNN_BLOCKS.NUM_FILTER))
            ]]
                                           'valid_datetime.pkl')
__C.HKO_SORTED_DAYS_PATH = os.path.join(__C.HKO_DATA_BASE_PATH,
                                        'sorted_day.pkl')
__C.HKO_RAINY_TRAIN_DAYS_PATH = os.path.join(__C.HKO_DATA_BASE_PATH,
                                             'hko7_rainy_train_days.txt')
__C.HKO_RAINY_VALID_DAYS_PATH = os.path.join(__C.HKO_DATA_BASE_PATH,
                                             'hko7_rainy_valid_days.txt')
__C.HKO_RAINY_TEST_DAYS_PATH = os.path.join(__C.HKO_DATA_BASE_PATH,
                                            'hko7_rainy_test_days.txt')

__C.HKO_PD = edict()
__C.HKO_PD.ALL = os.path.join(__C.HKO_PD_BASE_PATH, 'hko7_all.pkl')
__C.HKO_PD.ALL_09_14 = os.path.join(__C.HKO_PD_BASE_PATH, 'hko7_all_09_14.pkl')
__C.HKO_PD.ALL_15 = os.path.join(__C.HKO_PD_BASE_PATH, 'hko7_all_15.pkl')
__C.HKO_PD.RAINY_TRAIN = os.path.join(__C.HKO_PD_BASE_PATH,
                                      'hko7_rainy_train.pkl')
__C.HKO_PD.RAINY_VALID = os.path.join(__C.HKO_PD_BASE_PATH,
                                      'hko7_rainy_valid.pkl')
__C.HKO_PD.RAINY_TEST = os.path.join(__C.HKO_PD_BASE_PATH,
                                     'hko7_rainy_test.pkl')

__C.HKO.ITERATOR = edict()
__C.HKO.ITERATOR.WIDTH = 480
__C.HKO.ITERATOR.HEIGHT = 480
__C.HKO.ITERATOR.FILTER_RAINFALL = True  # Whether to discard part of the rainfall, has a denoising effect
__C.HKO.ITERATOR.FILTER_RAINFALL_THRESHOLD = 0.28  # All the pixel values that are smaller than round(threshold * 255) will be discarded

__C.MODEL = edict()
from nowcasting.models.model import activation
__C.MODEL.RNN_ACT_TYPE = activation('leaky', negative_slope=0.2, inplace=True)