Skip to main content

tfwn

Weight Normalization layer wrapper for TensorFlow-Keras API.

Inspired by Sean Morgan implementation, but:

  • No data initialization (only eager mode was implemented in original pull request).
  • Code refactoring
  • More tests
  • CIFAR10 example from original paper reimplemented

Examples

Unfortunately I couldn't reproduce parer results on CIFAR10 with batch size 100. As you can see there is no much difference in accuracy.

But with much smaller batch size model with weight normalization is much better then regular one.

How to use

import tensorflow as tf
from tfwn import WeightNorm


dense_wn = WeightNorm(tf.keras.layers.Dense(3))
out = dense_wn(input)

References

Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks

Tim Salimans, and Diederik P. Kingma.

@inproceedings{Salimans2016WeightNorm,
  title={Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks},
  author={Tim Salimans and Diederik P. Kingma},
  booktitle={Neural Information Processing Systems 2016},
  year={2016}
}

Metadata

Release files for tfwn 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tfwn 1.0.1
File Size Uploaded Provenance Actions
tfwn-1.0.1.tar.gz 5.0 kB Without provenance Details for tfwn-1.0.1.tar.gz

Release files / tfwn-1.0.1.tar.gz

Download URL tfwn-1.0.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4572f44092a7ab4a2a2c452f57b5090de626d500d879b3e4c7cfbdaf5c13e0a5
BLAKE2b-256 checksum
How to use checksums
bd5b98ac0c3b972f2550c5ce50c320ad65b14d70c38b5ec75f14bb504070ca0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

Security for tfwn 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page