Skip to content

thisisiron/spectral_normalization-tf2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Spectral Normalization TF2

Spectral Normalization implemented as Tensorflow 2.0

TODO

  • Convert simple conv2d model to DCGAN model

Run Test Code

This is currently a test code using a simple image classification model.

python main.py

Algorithm

How to use

  1. Sequential API
from sn import SpectralNormalization

model = models.Sequential()
model.add(SpectralNormalization(layers.Conv2D(32, (3, 3), activation='relu')))
...
  1. Functional API
from sn import SpectralNormalization

inputs = layers.Input(shape=(28,28,1))
x = SpectralNormalization(layers.Conv2D(32, (3, 3), activation='relu'))(inputs)
...
  1. Custom Layer Method
from sn import SpectralNormalization

class CustomLayer(tf.keras.layers.Layer):
    def __init__(self):
        self.conv2DSN = SpectralNormalization(layers.Conv2D(32, (3, 3), activation='relu'))
        ...
    
    def call(self, inputs):
        x = self.conv2DSN(inputs)
        ...

Rerference

Spectral Normalization for Generative Adversarial Networks

About

๐ŸŒˆ Spectral Normalization implemented as Tensorflow 2

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages