config.py 文件源码

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

项目:keras-image-captioning 作者: danieljl 项目源码 文件源码
def __init__(self, fixed_config_keys):
        super(CoarseRandomConfigBuilder, self).__init__(fixed_config_keys)

        self._batch_size = lambda: 32
        self._reduce_lr_factor = lambda: 1.0 - 1e-6
        self._reduce_lr_patience = lambda: sys.maxsize
        self._early_stopping_patience = lambda: 4
        self._lemmatize_caption = lambda: True
        self._rare_words_handling = lambda: 'nothing'
        self._words_min_occur = lambda: 1
        self._bidirectional_rnn = lambda: False
        self._initializer = lambda: 'he_normal'
        self._word_vector_init = lambda: None

        self._learning_rate = lambda: 10 ** uniform(-6, -2)
        self._dropout_rate = lambda: uniform(0, 1)
        self._l1_reg = lambda: 10 ** uniform(-7, 0)
        self._l2_reg = lambda: 10 ** uniform(-7, 0)

        self._embedding_size = lambda: int(2 ** uniform(6, 9))  # [64, 512]
        self._rnn_output_size = lambda: int(2 ** uniform(6, 9))  # [64, 512]
        self._rnn_type = lambda: choice(['lstm', 'gru'])
        self._rnn_layers = lambda: randint(1, 5)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号