Commit 77348359 authored by Silviu Nastasescu's avatar Silviu Nastasescu
Browse files

Added regularizer to prevent style ignorance

parent edd7be84
from tensorflow.keras import Model
from tensorflow.keras.layers import Layer, Dense, Reshape, Conv2D, Conv2DTranspose, MaxPool2D, BatchNormalization
from tensorflow_addons.layers import SpectralNormalization as SN
class MultiConv(Model):
......@@ -48,7 +49,7 @@ class StyleExtractionBlock(Layer):
super(StyleExtractionBlock, self).__init__(name='StyleExtractionBlock')
dims = output_shape[0]*output_shape[1]*output_shape[2]
self._denses = [Dense(dims//2**i, activation=activation) for i in range(1, layers)[::-1]]
self._output_layer = Dense(dims, activation='linear')
self._output_layer = SN(Dense(dims, activation='linear'))
self._reshape = Reshape(output_shape)
def call(self, x, training=False):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment