MapLRN

Description

Info

Parent class: LRN

Derived classes: -

This module implements the operation of intra-channel local response normalization.

Initializing

def __init__(self, N=5, alpha=1e-4, beta=0.75, K=2.0, name=None):

Parameters

Parameter Allowed types Description Default
N int Length of the side of the square area to normalize 5
alpha float Bias 1e-4
beta float Scale parameter 0.75
K float Incremental coefficient 2.0
name str Layer name None

Explanations

-

Examples

Necessary imports.

>>> import numpy as np
>>> from PuzzleLib.Backend import gpuarray
>>> from PuzzleLib.Modules import MapLRN

Info

gpuarray is required to properly place the tensor in the GPU

>>> batchsize, maps, h, w = 1, 1, 10, 10
>>> data = gpuarray.to_gpu(np.random.randn(batchsize, maps, h, w).astype(np.float32))
>>> lrn = MapLRN()
>>> lrn(data)