CrossMapLRN¶
Description¶
This module implements the operation of cross-map 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 | Number of channels to be summed | 5 |
alpha | float | Shift | 1e-4 |
beta | float | Scale parameter | 0.75 |
K | float | Additional 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 CrossMapLRN
Info
gpuarray
is required to properly place the tensor in the GPU.
batchsize, maps, h, w = 1, 10, 2, 2
data = gpuarray.to_gpu(np.random.randn(batchsize, maps, h, w).astype(np.float32))
lrn = CrossMapLRN()
lrn(data)