{"id":15700773,"url":"https://github.com/philipperemy/keras-mode-normalization","last_synced_at":"2025-10-13T02:40:39.657Z","repository":{"id":70249828,"uuid":"153764294","full_name":"philipperemy/keras-mode-normalization","owner":"philipperemy","description":"Keras Implementation of Mode Normalization (Lucas Deecke, Iain Murray, Hakan Bilen, 2018)","archived":false,"fork":false,"pushed_at":"2020-03-30T14:35:32.000Z","size":251993,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T14:25:56.527Z","etag":null,"topics":["batch-normalization","keras","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philipperemy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["philipperemy"]}},"created_at":"2018-10-19T10:12:16.000Z","updated_at":"2024-08-12T19:42:32.000Z","dependencies_parsed_at":"2023-03-04T13:00:31.885Z","dependency_job_id":null,"html_url":"https://github.com/philipperemy/keras-mode-normalization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/philipperemy/keras-mode-normalization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fkeras-mode-normalization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fkeras-mode-normalization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fkeras-mode-normalization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fkeras-mode-normalization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philipperemy","download_url":"https://codeload.github.com/philipperemy/keras-mode-normalization/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fkeras-mode-normalization/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259519290,"owners_count":22870331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch-normalization","keras","tensorflow"],"created_at":"2024-10-03T19:53:48.117Z","updated_at":"2025-10-13T02:40:34.609Z","avatar_url":"https://github.com/philipperemy.png","language":"Python","funding_links":["https://github.com/sponsors/philipperemy"],"categories":[],"sub_categories":[],"readme":"# Mode Normalization (Keras)\n\n```\nModeNormalization(axis=-1, k=2, momentum=0.99, epsilon=1e-3, center=True, scale=True, beta_initializer='zeros', gamma_initializer='ones', moving_mean_initializer='zeros', moving_variance_initializer='ones', beta_regularizer=None, gamma_regularizer=None, beta_constraint=None, gamma_constraint=None)\n```\n\nMode Normalization [Lucas Deecke, Iain Murray, Hakan Bilen - 2018](https://arxiv.org/pdf/1810.05466v1.pdf)\n\nNormalize the activations of the previous layer at each batch,\n    i.e. applies a transformation that maintains the mean activation\n    close to 0 and the activation standard deviation close to 1 for K\n    different modes.\n    \n## Arguments\n- **axis**: Integer, the axis that should be normalized (typically the features axis). For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`, set `axis=1` in `ModeNormalization`.\n- **k**: Integer, the number of modes of the normalization.\n- **momentum**: Momentum for the moving mean and the moving variance.\n- **epsilon**: Small float added to variance to avoid dividing by zero.\n- **center**: If True, add offset of `beta` to normalized tensor. If False, `beta` is ignored.\n- **scale**: If True, multiply by `gamma`. If False, `gamma` is not used. When the next layer is linear (also e.g. `nn.relu`), this can be disabled since the scaling will be done by the next layer.\n- **beta_initializer**: Initializer for the beta weight.\n- **gamma_initializer**: Initializer for the gamma weight.\n- **moving_mean_initializer**: Initializer for the moving mean.\n- **moving_variance_initializer**: Initializer for the moving variance.\n- **beta_regularizer**: Optional regularizer for the beta weight.\n- **gamma_regularizer**: Optional regularizer for the gamma weight.\n- **beta_constraint**: Optional constraint for the beta weight.\n- **gamma_constraint**: Optional constraint for the gamma weight.\n\n\n### Input shape\n- Arbitrary. Use the keyword argument `input_shape` (tuple of integers, does not include the samples axis) when using this layer as the first layer in a model.\n\n### Output shape\n- Same shape as input.\n\n### References\n- [Mode Normalization](https://arxiv.org/pdf/1810.05466v1.pdf)\n\n## SVHN dataset\n\n- https://drive.google.com/file/d/1O4LIHC1ttSeE6HM0haymPeao4nkTFW8y/view?usp=sharing\n\n## Run the tests\n\n`pytest`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipperemy%2Fkeras-mode-normalization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilipperemy%2Fkeras-mode-normalization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipperemy%2Fkeras-mode-normalization/lists"}