widgets.py 文件源码

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

项目:photinia 作者: XoriieInpottn 项目源码 文件源码
def _build(self):
        """Build the linear layer.
        Two parameters: weight and bias.

        :return: None.
        """
        bound = math.sqrt(6.0 / (self._input_size + self._output_size))
        w_init = tf.random_uniform(
            minval=-bound,
            maxval=bound,
            shape=(self._input_size, self._output_size),
            dtype=D_TYPE,
            name='w_init'
        )
        self._w = tf.Variable(w_init, dtype=D_TYPE, name='w')
        if self._with_bias:
            b_init = tf.zeros(
                shape=(self._output_size,),
                dtype=D_TYPE,
                name='b_init'
            )
            self._b = tf.Variable(b_init, dtype=D_TYPE, name='b')
        else:
            self._b = None
        self._batch_norm = BatchNorm('bn', self._output_size) if self._with_batch_norm else None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号