zl程序教程

您现在的位置是:首页 >  大数据

当前栏目

cs231 卷积神经网络Convolutional Networks群组归一化GN( Group Normalization)

神经网络 group 卷积 Networks 归一化 Convolutional Normalization 群组
2023-09-27 14:26:47 时间

cs231 Convolutional Networks Group Normalization:

 

 


def spatial_groupnorm_forward(x, gamma, beta, G, gn_param):
    """
    Computes the forward pass for spatial group normalization.
    In contrast to layer normalization, group normalization splits each entry 
    in the data into G contiguous pieces, which it then normalizes independently.
    Per feature shifting and scaling are then applied to the data, in a manner identical to that of batch normalization and layer normalization.

    Inputs:
    - x: Input data of shape (N, C, H, W)
    - gamma: Scale parameter, of shape (C,)
    - beta: Shift parameter, of shape (C,)
    - G: Integer mumber of groups to split into, should be a divisor of