Python keras.constraints 模块,nonneg() 实例源码

我们从Python开源项目中,提取了以下6个代码示例,用于说明如何使用keras.constraints.nonneg()

项目:keras    作者:GeekLiB    | 项目源码 | 文件源码
def test_nonneg():
    nonneg_instance = constraints.nonneg()
    normed = nonneg_instance(K.variable(example_array))
    assert(np.all(np.min(K.eval(normed), axis=1) == 0.))
项目:keras-recommendation    作者:sonyisme    | 项目源码 | 文件源码
def test_nonneg(self):
        from keras.constraints import nonneg

        nonneg_instance = nonneg()

        normed = nonneg_instance(self.example_array)
        assert (np.all(np.min(normed.eval(), axis=1) == 0.))
项目:keras-customized    作者:ambrite    | 项目源码 | 文件源码
def test_nonneg():
    nonneg_instance = constraints.nonneg()
    normed = nonneg_instance(K.variable(example_array))
    assert(np.all(np.min(K.eval(normed), axis=1) == 0.))
项目:keras    作者:NVIDIA    | 项目源码 | 文件源码
def test_nonneg():
    nonneg_instance = constraints.nonneg()
    normed = nonneg_instance(K.variable(example_array))
    assert(np.all(np.min(K.eval(normed), axis=1) == 0.))
项目:deep-coref    作者:clarkkev    | 项目源码 | 文件源码
def test_nonneg(self):
        from keras.constraints import nonneg

        nonneg_instance = nonneg()

        normed = nonneg_instance(self.example_array)
        assert (np.all(np.min(normed.eval(), axis=1) == 0.))
项目:RecommendationSystem    作者:TURuibo    | 项目源码 | 文件源码
def test_nonneg(self):
        from keras.constraints import nonneg

        nonneg_instance = nonneg()

        normed = nonneg_instance(self.example_array)
        assert (np.all(np.min(normed.eval(), axis=1) == 0.))