How to use the daal.algorithms.neural_networks.layers.convolution2d.Batch function in daal

To help you get started, we’ve selected a few daal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
res3b_branch2c.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res3b_branch2c_id = topology.add(res3b_branch2c)

    bn3b_branch2c = batch_normalization.Batch(fptype=np.float32)
    bn3b_branch2c_id = topology.add(bn3b_branch2c)

    res3b = eltwise_sum.Batch(fptype=np.float32)
    res3b_id = topology.add(res3b)

    res3b_relu = relu.Batch(fptype=np.float32)
    res3b_relu_id = topology.add(res3b_relu)

    res3b_relu_split6 = split.Batch(2, 2, fptype=np.float32)
    res3b_relu_split6_id = topology.add(res3b_relu_split6)

    res3c_branch2a = convolution2d.Batch(fptype=np.float32)
    res3c_branch2a.parameter.nKernels           = 128
    res3c_branch2a.parameter.kernelSizes        = convolution2d.KernelSizes(1, 1)
    res3c_branch2a.parameter.strides            = convolution2d.Strides(1, 1)
    res3c_branch2a.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res3c_branch2a.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res3c_branch2a_id = topology.add(res3c_branch2a)

    bn3c_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn3c_branch2a_id = topology.add(bn3c_branch2a)

    res3c_branch2a_relu = relu.Batch(fptype=np.float32)
    res3c_branch2a_relu_id = topology.add(res3c_branch2a_relu)

    res3c_branch2b = convolution2d.Batch(fptype=np.float32)
    res3c_branch2b.parameter.nKernels           = 128
    res3c_branch2b.parameter.kernelSizes        = convolution2d.KernelSizes(3, 3)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
res5a_branch2c.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res5a_branch2c_id = topology.add(res5a_branch2c)

    bn5a_branch2c = batch_normalization.Batch(fptype=np.float32)
    bn5a_branch2c_id = topology.add(bn5a_branch2c)

    res5a = eltwise_sum.Batch(fptype=np.float32)
    res5a_id = topology.add(res5a)

    res5a_relu = relu.Batch(fptype=np.float32)
    res5a_relu_id = topology.add(res5a_relu)

    res5a_relu_split15 = split.Batch(2, 2, fptype=np.float32)
    res5a_relu_split15_id = topology.add(res5a_relu_split15)

    res5b_branch2a = convolution2d.Batch(fptype=np.float32)
    res5b_branch2a.parameter.nKernels           = 512
    res5b_branch2a.parameter.kernelSizes        = convolution2d.KernelSizes(1, 1)
    res5b_branch2a.parameter.strides            = convolution2d.Strides(1, 1)
    res5b_branch2a.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res5b_branch2a.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res5b_branch2a_id = topology.add(res5b_branch2a)

    bn5b_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn5b_branch2a_id = topology.add(bn5b_branch2a)

    res5b_branch2a_relu = relu.Batch(fptype=np.float32)
    res5b_branch2a_relu_id = topology.add(res5b_branch2a_relu)

    res5b_branch2b = convolution2d.Batch(fptype=np.float32)
    res5b_branch2b.parameter.nKernels           = 512
    res5b_branch2b.parameter.kernelSizes        = convolution2d.KernelSizes(3, 3)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
res3a_branch2c.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res3a_branch2c_id = topology.add(res3a_branch2c)

    bn3a_branch2c = batch_normalization.Batch(fptype=np.float32)
    bn3a_branch2c_id = topology.add(bn3a_branch2c)

    res3a = eltwise_sum.Batch(fptype=np.float32)
    res3a_id = topology.add(res3a)

    res3a_relu = relu.Batch(fptype=np.float32)
    res3a_relu_id = topology.add(res3a_relu)

    res3a_relu_split5 = split.Batch(2, 2, fptype=np.float32)
    res3a_relu_split5_id = topology.add(res3a_relu_split5)

    res3b_branch2a = convolution2d.Batch(fptype=np.float32)
    res3b_branch2a.parameter.nKernels           = 128
    res3b_branch2a.parameter.kernelSizes        = convolution2d.KernelSizes(1, 1)
    res3b_branch2a.parameter.strides            = convolution2d.Strides(1, 1)
    res3b_branch2a.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res3b_branch2a.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res3b_branch2a_id = topology.add(res3b_branch2a)

    bn3b_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn3b_branch2a_id = topology.add(bn3b_branch2a)

    res3b_branch2a_relu = relu.Batch(fptype=np.float32)
    res3b_branch2a_relu_id = topology.add(res3b_branch2a_relu)

    res3b_branch2b = convolution2d.Batch(fptype=np.float32)
    res3b_branch2b.parameter.nKernels           = 128
    res3b_branch2b.parameter.kernelSizes        = convolution2d.KernelSizes(3, 3)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
res3d_branch2b = convolution2d.Batch(fptype=np.float32)
    res3d_branch2b.parameter.nKernels           = 128
    res3d_branch2b.parameter.kernelSizes        = convolution2d.KernelSizes(3, 3)
    res3d_branch2b.parameter.strides            = convolution2d.Strides(1, 1)
    res3d_branch2b.parameter.paddings           = convolution2d.Paddings(1, 1)
    res3d_branch2b.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res3d_branch2b.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res3d_branch2b_id = topology.add(res3d_branch2b)

    bn3d_branch2b = batch_normalization.Batch(fptype=np.float32)
    bn3d_branch2b_id = topology.add(bn3d_branch2b)

    res3d_branch2b_relu = relu.Batch(fptype=np.float32)
    res3d_branch2b_relu_id = topology.add(res3d_branch2b_relu)

    res3d_branch2c = convolution2d.Batch(fptype=np.float32)
    res3d_branch2c.parameter.nKernels           = 512
    res3d_branch2c.parameter.kernelSizes        = convolution2d.KernelSizes(1, 1)
    res3d_branch2c.parameter.strides            = convolution2d.Strides(1, 1)
    res3d_branch2c.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res3d_branch2c.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res3d_branch2c_id = topology.add(res3d_branch2c)

    bn3d_branch2c = batch_normalization.Batch(fptype=np.float32)
    bn3d_branch2c_id = topology.add(bn3d_branch2c)

    res3d = eltwise_sum.Batch(fptype=np.float32)
    res3d_id = topology.add(res3d)

    res3d_relu = relu.Batch(fptype=np.float32)
    res3d_relu_id = topology.add(res3d_relu)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
res2a_branch2a = convolution2d.Batch(fptype=np.float32)
    res2a_branch2a.parameter.nKernels           = 64
    res2a_branch2a.parameter.kernelSizes        = convolution2d.KernelSizes(1, 1)
    res2a_branch2a.parameter.strides            = convolution2d.Strides(1, 1)
    res2a_branch2a.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res2a_branch2a.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res2a_branch2a_id = topology.add(res2a_branch2a)

    bn2a_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn2a_branch2a_id = topology.add(bn2a_branch2a)

    res2a_branch2a_relu = relu.Batch(fptype=np.float32)
    res2a_branch2a_relu_id = topology.add(res2a_branch2a_relu)

    res2a_branch2b = convolution2d.Batch(fptype=np.float32)
    res2a_branch2b.parameter.nKernels           = 64
    res2a_branch2b.parameter.kernelSizes        = convolution2d.KernelSizes(3, 3)
    res2a_branch2b.parameter.strides            = convolution2d.Strides(1, 1)
    res2a_branch2b.parameter.paddings           = convolution2d.Paddings(1, 1)
    res2a_branch2b.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res2a_branch2b.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res2a_branch2b_id = topology.add(res2a_branch2b)

    bn2a_branch2b = batch_normalization.Batch(fptype=np.float32)
    bn2a_branch2b_id = topology.add(bn2a_branch2b)

    res2a_branch2b_relu = relu.Batch(fptype=np.float32)
    res2a_branch2b_relu_id = topology.add(res2a_branch2b_relu)

    res2a_branch2c = convolution2d.Batch(fptype=np.float32)
    res2a_branch2c.parameter.nKernels           = 256
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
res4f_branch2b = convolution2d.Batch(fptype=np.float32)
    res4f_branch2b.parameter.nKernels           = 256
    res4f_branch2b.parameter.kernelSizes        = convolution2d.KernelSizes(3, 3)
    res4f_branch2b.parameter.strides            = convolution2d.Strides(1, 1)
    res4f_branch2b.parameter.paddings           = convolution2d.Paddings(1, 1)
    res4f_branch2b.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res4f_branch2b.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res4f_branch2b_id = topology.add(res4f_branch2b)

    bn4f_branch2b = batch_normalization.Batch(fptype=np.float32)
    bn4f_branch2b_id = topology.add(bn4f_branch2b)

    res4f_branch2b_relu = relu.Batch(fptype=np.float32)
    res4f_branch2b_relu_id = topology.add(res4f_branch2b_relu)

    res4f_branch2c = convolution2d.Batch(fptype=np.float32)
    res4f_branch2c.parameter.nKernels           = 1024
    res4f_branch2c.parameter.kernelSizes        = convolution2d.KernelSizes(1, 1)
    res4f_branch2c.parameter.strides            = convolution2d.Strides(1, 1)
    res4f_branch2c.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res4f_branch2c.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res4f_branch2c_id = topology.add(res4f_branch2c)

    bn4f_branch2c = batch_normalization.Batch(fptype=np.float32)
    bn4f_branch2c_id = topology.add(bn4f_branch2c)

    res4f = eltwise_sum.Batch(fptype=np.float32)
    res4f_id = topology.add(res4f)

    res4f_relu = relu.Batch(fptype=np.float32)
    res4f_relu_id = topology.add(res4f_relu)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
res3c_branch2c.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res3c_branch2c_id = topology.add(res3c_branch2c)

    bn3c_branch2c = batch_normalization.Batch(fptype=np.float32)
    bn3c_branch2c_id = topology.add(bn3c_branch2c)

    res3c = eltwise_sum.Batch(fptype=np.float32)
    res3c_id = topology.add(res3c)

    res3c_relu = relu.Batch(fptype=np.float32)
    res3c_relu_id = topology.add(res3c_relu)

    res3c_relu_split7 = split.Batch(2, 2, fptype=np.float32)
    res3c_relu_split7_id = topology.add(res3c_relu_split7)

    res3d_branch2a = convolution2d.Batch(fptype=np.float32)
    res3d_branch2a.parameter.nKernels           = 128
    res3d_branch2a.parameter.kernelSizes        = convolution2d.KernelSizes(1, 1)
    res3d_branch2a.parameter.strides            = convolution2d.Strides(1, 1)
    res3d_branch2a.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res3d_branch2a.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res3d_branch2a_id = topology.add(res3d_branch2a)

    bn3d_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn3d_branch2a_id = topology.add(bn3d_branch2a)

    res3d_branch2a_relu = relu.Batch(fptype=np.float32)
    res3d_branch2a_relu_id = topology.add(res3d_branch2a_relu)

    res3d_branch2b = convolution2d.Batch(fptype=np.float32)
    res3d_branch2b.parameter.nKernels           = 128
    res3d_branch2b.parameter.kernelSizes        = convolution2d.KernelSizes(3, 3)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
res4a_branch2b = convolution2d.Batch(fptype=np.float32)
    res4a_branch2b.parameter.nKernels           = 256
    res4a_branch2b.parameter.kernelSizes        = convolution2d.KernelSizes(3, 3)
    res4a_branch2b.parameter.strides            = convolution2d.Strides(1, 1)
    res4a_branch2b.parameter.paddings           = convolution2d.Paddings(1, 1)
    res4a_branch2b.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res4a_branch2b.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res4a_branch2b_id = topology.add(res4a_branch2b)

    bn4a_branch2b = batch_normalization.Batch(fptype=np.float32)
    bn4a_branch2b_id = topology.add(bn4a_branch2b)

    res4a_branch2b_relu = relu.Batch(fptype=np.float32)
    res4a_branch2b_relu_id = topology.add(res4a_branch2b_relu)

    res4a_branch2c = convolution2d.Batch(fptype=np.float32)
    res4a_branch2c.parameter.nKernels           = 1024
    res4a_branch2c.parameter.kernelSizes        = convolution2d.KernelSizes(1, 1)
    res4a_branch2c.parameter.strides            = convolution2d.Strides(1, 1)
    res4a_branch2c.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res4a_branch2c.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res4a_branch2c_id = topology.add(res4a_branch2c)

    bn4a_branch2c = batch_normalization.Batch(fptype=np.float32)
    bn4a_branch2c_id = topology.add(bn4a_branch2c)

    res4a = eltwise_sum.Batch(fptype=np.float32)
    res4a_id = topology.add(res4a)

    res4a_relu = relu.Batch(fptype=np.float32)
    res4a_relu_id = topology.add(res4a_relu)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
res3a_branch2a = convolution2d.Batch(fptype=np.float32)
    res3a_branch2a.parameter.nKernels           = 128
    res3a_branch2a.parameter.kernelSizes        = convolution2d.KernelSizes(1, 1)
    res3a_branch2a.parameter.strides            = convolution2d.Strides(2, 2)
    res3a_branch2a.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res3a_branch2a.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res3a_branch2a_id = topology.add(res3a_branch2a)

    bn3a_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn3a_branch2a_id = topology.add(bn3a_branch2a)

    res3a_branch2a_relu = relu.Batch(fptype=np.float32)
    res3a_branch2a_relu_id = topology.add(res3a_branch2a_relu)

    res3a_branch2b = convolution2d.Batch(fptype=np.float32)
    res3a_branch2b.parameter.nKernels           = 128
    res3a_branch2b.parameter.kernelSizes        = convolution2d.KernelSizes(3, 3)
    res3a_branch2b.parameter.strides            = convolution2d.Strides(1, 1)
    res3a_branch2b.parameter.paddings           = convolution2d.Paddings(1, 1)
    res3a_branch2b.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res3a_branch2b.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res3a_branch2b_id = topology.add(res3a_branch2b)

    bn3a_branch2b = batch_normalization.Batch(fptype=np.float32)
    bn3a_branch2b_id = topology.add(bn3a_branch2b)

    res3a_branch2b_relu = relu.Batch(fptype=np.float32)
    res3a_branch2b_relu_id = topology.add(res3a_branch2b_relu)

    res3a_branch2c = convolution2d.Batch(fptype=np.float32)
    res3a_branch2c.parameter.nKernels           = 512
github intel / daal / samples / python / neural_networks / sources / daal_lenet.py View on Github external
# Create convolution layer
    convolution1 = convolution2d.Batch()
    convolution1.parameter.kernelSizes = convolution2d.KernelSizes(3, 3)
    convolution1.parameter.strides = convolution2d.Strides(1, 1)
    convolution1.parameter.nKernels = 32
    convolution1.parameter.weightsInitializer = initializers.xavier.Batch()
    convolution1.parameter.biasesInitializer = initializers.uniform.Batch(0, 0)

    # Create pooling layer
    maxpooling1 = maximum_pooling2d.Batch(4)
    maxpooling1.parameter.kernelSizes = pooling2d.KernelSizes(2, 2)
    maxpooling1.parameter.paddings = pooling2d.Paddings(0, 0)
    maxpooling1.parameter.strides = pooling2d.Strides(2, 2)

    # Create convolution layer
    convolution2 = convolution2d.Batch()
    convolution2.parameter.kernelSizes = convolution2d.KernelSizes(5, 5)
    convolution2.parameter.strides = convolution2d.Strides(1, 1)
    convolution2.parameter.nKernels = 64
    convolution2.parameter.weightsInitializer = initializers.xavier.Batch()
    convolution2.parameter.biasesInitializer = initializers.uniform.Batch(0, 0)

    # Create pooling layer
    maxpooling2 = maximum_pooling2d.Batch(4)
    maxpooling2.parameter.kernelSizes = pooling2d.KernelSizes(2, 2)
    maxpooling2.parameter.paddings = pooling2d.Paddings(0, 0)
    maxpooling2.parameter.strides = pooling2d.Strides(2, 2)

    # Create fullyconnected layer
    fullyconnected3 = fullyconnected.Batch(256)
    fullyconnected3.parameter.weightsInitializer = initializers.xavier.Batch()
    fullyconnected3.parameter.biasesInitializer = initializers.uniform.Batch(0, 0)