示例#1
0
def model_discriminator(input_shape=(1, 28, 28), dropout_rate=0.5):
    d_input = dim_ordering_input(input_shape, name="input_x")
    nch = 512
    # nch = 128
    H = Conv2D(
        int(nch / 2),
        (5, 5),
        strides=(2, 2),
        padding="same",
        activation="relu",
    )(d_input)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)
    H = Conv2D(
        nch,
        (5, 5),
        strides=(2, 2),
        padding="same",
        activation="relu",
    )(H)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)
    H = Flatten()(H)
    H = Dense(int(nch / 2))(H)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)
    d_V = Dense(1, activation="sigmoid")(H)
    return Model(d_input, d_V)
示例#2
0
def model_discriminator(input_shape=(1, 92, 92), dropout_rate=0.5):
    d_input = dim_ordering_input(input_shape, name="input_x")
    nch = 128
    # nch = 128
    H = Convolution2D(int(nch / 2),
                      5,
                      5,
                      subsample=(2, 2),
                      border_mode='same',
                      activation='relu')(d_input)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)
    H = Convolution2D(nch,
                      5,
                      5,
                      subsample=(2, 2),
                      border_mode='same',
                      activation='relu')(H)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)
    H = Flatten()(H)
    H = Dense(int(nch / 2))(H)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)
    d_V = Dense(1, activation='sigmoid')(H)
    return Model(d_input, d_V)
def model_discriminator(input_shape=(1, 28, 28), dropout_rate=0.5):
    d_input = dim_ordering_input(input_shape, name="input_x")
    nch = 512
    # nch = 128
    H = Convolution2D(int(nch / 2), 5, 5, subsample=(2, 2), border_mode='same', activation='relu')(d_input)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)
    H = Convolution2D(nch, 5, 5, subsample=(2, 2), border_mode='same', activation='relu')(H)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)
    H = Flatten()(H)
    H = Dense(int(nch / 2))(H)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)
    d_V = Dense(1, activation='sigmoid')(H)
    return Model(d_input, d_V)
示例#4
0
def model_discriminator(input_shape=(1, 28, 28), dropout_rate=0.5):
    ch_num = 512
    d_input = dim_ordering_input(input_shape, name='input_x')
    H = Conv2D(int(ch_num / 2), (5, 5),
               strides=(2, 2),
               padding='same',
               activation='relu')(d_input)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)
    H = Conv2D(ch_num, (5, 5),
               strides=(2, 2),
               padding='same',
               activation='relu')(H)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)
    H = Flatten()(H)
    H = Dense(int(ch_num / 2))(H)
    H = LeakyReLU(0.2)(H)
    d_V = Dense(1, activation='sigmoid')(H)
    return Model(d_input, d_V)
示例#5
0
def model_discriminator(input_shape=(1, 28, 28), dropout_rate=0.5):
    d_input = dim_ordering_input(input_shape, name="input_x")

    nch = 512

    H = Conv2D(256, 5, 5, subsample=(2, 2), border_mode='same')(d_input)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)

    H = Conv2D(512, 5, 5, subsample=(2, 2), border_mode='same')(H)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)

    H = Flatten()(H)

    H = Dense(256)(H)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout_rate)(H)

    d_V = Dense(1, activation='sigmoid')(H)

    return Model(d_input, d_V)
示例#6
0
def discriminator(input_shape=(1, 28, 28), dropout=0.5):
    d_input = dim_ordering_input(input_shape, name='input_x')
    c = 512
    H = Convolution2D(int(c / 2),
                      kernel_size=5,
                      strides=5,
                      padding='same',
                      activation='relu')(d_input)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout)(H)
    H = Convolution2D(c,
                      kernel_size=5,
                      strides=5,
                      padding='same',
                      activation='relu')(H)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout)(H)
    H = Flatten()(H)
    H = Dense(int(c / 2))(H)
    H = LeakyReLU(0.2)(H)
    H = Dropout(dropout)(H)
    d_V = Dense(1, activation='sigmoid')(H)
    return Model(d_input, d_V)
示例#7
0
def model_discriminator(input_shape=(1, 28, 28), dropout_rate=0.5):
    d_input = dim_ordering_input(input_shape, name="input_x")
    nch = 512
    
    return Model(d_input, d_V)