当前位置: 首页>>代码示例>>Python>>正文


Python type.TypedListType类代码示例

本文整理汇总了Python中theano.typed_list.type.TypedListType的典型用法代码示例。如果您正苦于以下问题:Python TypedListType类的具体用法?Python TypedListType怎么用?Python TypedListType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TypedListType类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_interface

    def test_interface(self):
        mySymbolicMatricesList = TypedListType(T.TensorType(theano.config.floatX, (False, False)))()
        z = mySymbolicMatricesList.__len__()

        f = theano.function([mySymbolicMatricesList], z)

        x = rand_ranged_matrix(-1000, 1000, [100, 101])

        self.assertTrue(f([x, x]) == 2)
开发者ID:cfsmile,项目名称:Theano,代码行数:9,代码来源:test_basic.py

示例2: test_filter_sanity_check

    def test_filter_sanity_check(self):
        # Simple test on typed list type filter

        myType = TypedListType(T.TensorType(theano.config.floatX,
                                            (False, False)))

        x = rand_ranged_matrix(-1000, 1000, [100, 100])

        self.assertTrue(np.array_equal(myType.filter([x]), [x]))
开发者ID:DEVESHTARASIA,项目名称:Theano,代码行数:9,代码来源:test_type.py

示例3: test_get_depth

    def test_get_depth(self):
        # test case for get_depth utilitary function

        myType = TypedListType(T.TensorType(theano.config.floatX,
                                            (False, False)))

        myManualNestedType = TypedListType(TypedListType(
                                           TypedListType(myType)))

        self.assertTrue(myManualNestedType.get_depth() == 3)
开发者ID:DEVESHTARASIA,项目名称:Theano,代码行数:10,代码来源:test_type.py

示例4: test_intern_filter

    def test_intern_filter(self):
        # Test checking if values contained are themselves
        # filtered. If they weren't this code would raise
        # an exception.

        myType = TypedListType(T.TensorType('float64',
                                            (False, False)))

        x = np.asarray([[4, 5], [4, 5]], dtype='float32')

        self.assertTrue(np.array_equal(myType.filter([x]), [x]))
开发者ID:DEVESHTARASIA,项目名称:Theano,代码行数:11,代码来源:test_type.py

示例5: test_basic_nested_list

    def test_basic_nested_list(self):
        # Testing nested list with one level of depth

        myNestedType = TypedListType(T.TensorType(theano.config.floatX,
                                                  (False, False)))

        myType = TypedListType(myNestedType)

        x = rand_ranged_matrix(-1000, 1000, [100, 100])

        self.assertTrue(np.array_equal(myType.filter([[x]]), [[x]]))
开发者ID:DEVESHTARASIA,项目名称:Theano,代码行数:11,代码来源:test_type.py

示例6: test_interfaces

    def test_interfaces(self):
        mySymbolicMatricesList = TypedListType(T.TensorType(theano.config.floatX, (False, False)))()
        myMatrix = T.matrix()

        z = mySymbolicMatricesList.append(myMatrix)

        f = theano.function([mySymbolicMatricesList, myMatrix], z)

        x = rand_ranged_matrix(-1000, 1000, [100, 101])

        y = rand_ranged_matrix(-1000, 1000, [100, 101])

        self.assertTrue(numpy.array_equal(f([x], y), [x, y]))
开发者ID:cfsmile,项目名称:Theano,代码行数:13,代码来源:test_basic.py

示例7: test_interface

    def test_interface(self):
        mySymbolicMatricesList1 = TypedListType(T.TensorType(
            theano.config.floatX, (False, False)))()
        mySymbolicMatricesList2 = TypedListType(T.TensorType(
            theano.config.floatX, (False, False)))()

        z = mySymbolicMatricesList1.extend(mySymbolicMatricesList2)

        f = theano.function([mySymbolicMatricesList1, mySymbolicMatricesList2],
                            z)

        x = rand_ranged_matrix(-1000, 1000, [100, 101])

        y = rand_ranged_matrix(-1000, 1000, [100, 101])

        self.assertTrue(np.array_equal(f([x], [y]), [x, y]))
开发者ID:DEVESHTARASIA,项目名称:Theano,代码行数:16,代码来源:test_basic.py


注:本文中的theano.typed_list.type.TypedListType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。