How to use the daal.algorithms.neural_networks.layers.batch_normalization.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
bn4a_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn4a_branch2a_id = topology.add(bn4a_branch2a)

    res4a_branch2a_relu = relu.Batch(fptype=np.float32)
    res4a_branch2a_relu_id = topology.add(res4a_branch2a_relu)

    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)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
bn4d_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn4d_branch2a_id = topology.add(bn4d_branch2a)

    res4d_branch2a_relu = relu.Batch(fptype=np.float32)
    res4d_branch2a_relu_id = topology.add(res4d_branch2a_relu)

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

    bn4d_branch2b = batch_normalization.Batch(fptype=np.float32)
    bn4d_branch2b_id = topology.add(bn4d_branch2b)

    res4d_branch2b_relu = relu.Batch(fptype=np.float32)
    res4d_branch2b_relu_id = topology.add(res4d_branch2b_relu)

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

    bn4d_branch2c = batch_normalization.Batch(fptype=np.float32)
    bn4d_branch2c_id = topology.add(bn4d_branch2c)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
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)
    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)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
bn4e_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn4e_branch2a_id = topology.add(bn4e_branch2a)

    res4e_branch2a_relu = relu.Batch(fptype=np.float32)
    res4e_branch2a_relu_id = topology.add(res4e_branch2a_relu)

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

    bn4e_branch2b = batch_normalization.Batch(fptype=np.float32)
    bn4e_branch2b_id = topology.add(bn4e_branch2b)

    res4e_branch2b_relu = relu.Batch(fptype=np.float32)
    res4e_branch2b_relu_id = topology.add(res4e_branch2b_relu)

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

    bn4e_branch2c = batch_normalization.Batch(fptype=np.float32)
    bn4e_branch2c_id = topology.add(bn4e_branch2c)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
res4e_relu = relu.Batch(fptype=np.float32)
    res4e_relu_id = topology.add(res4e_relu)

    res4e_relu_split13 = split.Batch(2, 2, fptype=np.float32)
    res4e_relu_split13_id = topology.add(res4e_relu_split13)

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

    bn4f_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn4f_branch2a_id = topology.add(bn4f_branch2a)

    res4f_branch2a_relu = relu.Batch(fptype=np.float32)
    res4f_branch2a_relu_id = topology.add(res4f_branch2a_relu)

    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)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
bn5a_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn5a_branch2a_id = topology.add(bn5a_branch2a)

    res5a_branch2a_relu = relu.Batch(fptype=np.float32)
    res5a_branch2a_relu_id = topology.add(res5a_branch2a_relu)

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

    bn5a_branch2b = batch_normalization.Batch(fptype=np.float32)
    bn5a_branch2b_id = topology.add(bn5a_branch2b)

    res5a_branch2b_relu = relu.Batch(fptype=np.float32)
    res5a_branch2b_relu_id = topology.add(res5a_branch2b_relu)

    res5a_branch2c = convolution2d.Batch(fptype=np.float32)
    res5a_branch2c.parameter.nKernels           = 2048
    res5a_branch2c.parameter.kernelSizes        = convolution2d.KernelSizes(1, 1)
    res5a_branch2c.parameter.strides            = convolution2d.Strides(1, 1)
    res5a_branch2c.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    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)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
res4a_relu = relu.Batch(fptype=np.float32)
    res4a_relu_id = topology.add(res4a_relu)

    res4a_relu_split9 = split.Batch(2, 2, fptype=np.float32)
    res4a_relu_split9_id = topology.add(res4a_relu_split9)

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

    bn4b_branch2a = batch_normalization.Batch(fptype=np.float32)
    bn4b_branch2a_id = topology.add(bn4b_branch2a)

    res4b_branch2a_relu = relu.Batch(fptype=np.float32)
    res4b_branch2a_relu_id = topology.add(res4b_branch2a_relu)

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

    bn4b_branch2b = batch_normalization.Batch(fptype=np.float32)
    bn4b_branch2b_id = topology.add(bn4b_branch2b)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
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)
    res5b_branch2b.parameter.strides            = convolution2d.Strides(1, 1)
    res5b_branch2b.parameter.paddings           = convolution2d.Paddings(1, 1)
    res5b_branch2b.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    res5b_branch2b.parameter.biasesInitializer  = uniform.Batch(0, 0, fptype=np.float32)
    res5b_branch2b_id = topology.add(res5b_branch2b)

    bn5b_branch2b = batch_normalization.Batch(fptype=np.float32)
    bn5b_branch2b_id = topology.add(bn5b_branch2b)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
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
    res3a_branch2c.parameter.kernelSizes        = convolution2d.KernelSizes(1, 1)
    res3a_branch2c.parameter.strides            = convolution2d.Strides(1, 1)
    res3a_branch2c.parameter.weightsInitializer = xavier.Batch(fptype=np.float32)
    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)
github intel / daal / samples / python / neural_networks / sources / daal_resnet_50.py View on Github external
pool1.parameter.kernelSizes = pooling2d.KernelSizes(3, 3)
    pool1.parameter.strides     = pooling2d.Strides(2, 2)
    pool1_id = topology.add(pool1)

    pool1_split1 = split.Batch(2, 2, fptype=np.float32)
    pool1_split1_id = topology.add(pool1_split1)

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

    bn2a_branch1 = batch_normalization.Batch(fptype=np.float32)
    bn2a_branch1_id = topology.add(bn2a_branch1)

    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)