models.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:rascal-tensorflow 作者: stayrascal 项目源码 文件源码
def cnn3_full1_rnn1():
    img_input = Input(shape=(120, 160, 3), name="img_input")

    x = Convolution2D(8, 3, 3)(img_input)
    x = Activation('relu')(x)
    x = MaxPooling2D(pool_size=(2, 2))(x)

    x = Convolution2D(16, 3, 3)(x)
    x = Activation('relu')(x)
    x = MaxPooling2D(pool_size=(2, 2))(x)

    x = Convolution2D(32, 3, 3)(x)
    x = Activation('relu')(x)
    x = MaxPooling2D(pool_size=(2, 2))(x)

    merged = Flatten()(x)

    x = Dense(256)(merged)
    x = Activation('linear')(x)
    x = Dropout(.2)(x)

    x = Reshape((1, 256))(merged)
    x = SimpleRNN(256, activation='linear')(x)

    throttle_out = Dense(1, name="throttle_out")(x)
    angle_out = Dense(1, name="angle_out")(x)

    model = Model(input=[img_input], output=[angle_out])
    model.compile(optimizer='adam', loss='mean_squared_error')

    return model
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号