Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Problem loading network that contains GroupNorm operator - mxnet v2.0 #19843

Answered by feevos
feevos asked this question in Q&A
Discussion options

You must be logged in to vote

Dear all,

I finally use this GroupNorm definition, and it looks good for running and loading models:

import mxnet as mx
from mxnet.gluon import HybridBlock
from mxnet.gluon.parameter import Parameter

@mx.use_np
class GroupNorm(HybridBlock):
    r"""
    Applies group normalization to the n-dimensional input array.
    This operator takes an n-dimensional input array where the leftmost 2 axis are
    `batch` and `channel` respectively:
    .. math::
      x = x.reshape((N, num_groups, C // num_groups, ...))
      axis = (2, ...)
      out = \frac{x - mean[x, axis]}{ \sqrt{Var[x, axis] + \epsilon}} * gamma + beta
    Parameters
    ----------
    num_groups: int, default 1
        Number o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by feevos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant