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


Python NeuralNetwork.addLayer方法代码示例

本文整理汇总了Python中NeuralNetwork.NeuralNetwork.addLayer方法的典型用法代码示例。如果您正苦于以下问题:Python NeuralNetwork.addLayer方法的具体用法?Python NeuralNetwork.addLayer怎么用?Python NeuralNetwork.addLayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NeuralNetwork.NeuralNetwork的用法示例。


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

示例1: createLocalizationNetwork

# 需要导入模块: from NeuralNetwork import NeuralNetwork [as 别名]
# 或者: from NeuralNetwork.NeuralNetwork import addLayer [as 别名]
    def createLocalizationNetwork(self):
        
        if self.localizationType == "Rotary":
            return RotaryLayer()
        
        if self.localizationType == "Scaled":
            return ScaledLayer()
        
        if self.localizationType == "ScaledUp":
            return ScaledUpLayer()
        
        if self.localizationType == "ScaledWithOffset":
            return ScaledWithOffsetLayer()
        
        if self.localizationType == "Unitary":
            return UnitaryLayer()
        
        if self.localizationType == "FullyConnected":
            network = NeuralNetwork()
            network.addLayer(FullyConnectedLayer(self.inputW * self.inputH * self.inputC, 32, 0, "ReLu"))
            network.addLayer(FullyConnectedLayer(32, 3*4, 1, "ReLu"))
            return network

        if self.localizationType == "ConvLayer":
            network = NeuralNetwork()
            network.addLayer(ConvLayer((self.inputW, self.inputH, self.inputC), (3, 3, self.inputC, self.inputC), 0, "ReLu"))
            network.addLayer(FullyConnectedLayer(self.inputW * self.inputH * self.inputC, 3*4, 1, "ReLu"))
            return network
开发者ID:sudnya,项目名称:misc,代码行数:30,代码来源:SpatialTransformerLayer.py

示例2: createFullyConnectedNetwork

# 需要导入模块: from NeuralNetwork import NeuralNetwork [as 别名]
# 或者: from NeuralNetwork.NeuralNetwork import addLayer [as 别名]
    def createFullyConnectedNetwork(parameters):
        logger.info ("Creating a fully connected network")
        network = NeuralNetwork()
        
        idx = 0
        for inputSize, outputSize in parameters:
            isLastLayer = (idx == (len(parameters) - 1))

            if isLastLayer:
                nonlinearity = "Null"
            else:
                nonlinearity = "ReLu"

            network.addLayer(FullyConnectedLayer(inputSize, outputSize, idx, nonlinearity))
            idx += 1

        return network
开发者ID:sudnya,项目名称:misc,代码行数:19,代码来源:NeuralNetworkBuilder.py

示例3: createSpatialTransformerWithFullyConnectedNetwork

# 需要导入模块: from NeuralNetwork import NeuralNetwork [as 别名]
# 或者: from NeuralNetwork.NeuralNetwork import addLayer [as 别名]
    def createSpatialTransformerWithFullyConnectedNetwork(parameters, isVerbose):
        logger.info ("Creating a fully connected network with a spatial transformer input layer")
        network = NeuralNetwork()
        
        idx = 0
        for inputSize, outputSize in parameters:
            isLastLayer = (idx == (len(parameters) - 1))

            if isLastLayer:
                nonlinearity = "Null"
            else:
                nonlinearity = "ReLu"

            if idx == 0:
                network.addLayer(SpatialTransformerLayer(inputSize[0], inputSize[1], inputSize[2],
                    outputSize[0], outputSize[1], outputSize[2], "ConvLayer"))
            else:
                network.addLayer(FullyConnectedLayer(inputSize, outputSize, idx, nonlinearity))
            idx += 1

        return network
开发者ID:sudnya,项目名称:misc,代码行数:23,代码来源:NeuralNetworkBuilder.py


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