Transfer "IShengFang/SpectralNormalizationKeras" to tf.keras
I created this repo, because Keras and tf.keras are not compatible, and some libs of Keras are not supported by old Tensorflow versions.
Enviro: Tensorflow 1.12.0
- Move SNorm_tf_keras.py to your code's dir.
- Import layers like
from SpectralNormalizationKeras import DenseSN, ConvSN1D, ConvSN2D, ConvSN3D
- Use them like normal layers (but only in discriminators mentioned in the paper).
PS: if anyone found this error:No module named 'tensorflow.keras.engine'
. Change line 6 to from tensorflow.python.keras.layers import Layer
.