I am learning StyleGAN architecture and I got confused about the purpose of the Mapping Network. In the original paper it says:
Our mapping network consists of 8 fully-connected layers, and the dimensionality of all input and output activations— including z and w — is 512.
And there is no information about this network being trained in any way.
Like, wouldn’t it just generate some nonsense values?
I've tried creating a network like that (but with a smaller shape (16,)
):
import tensorflow as tf
import numpy as np
model = tf.keras.models.Sequential()
model.add(tf.keras.Input(shape=(16)))
for i in range(7):
model.add(tf.keras.layers.Dense(16, activation='relu'))
model.compile()
and then evaluated it on some random values:
g = tf.random.Generator.from_seed(34)
model(
g.normal(shape=(16, 16))
)
And I am getting some random outputs like:
array([[0. , 0.01045225, 0. , 0. , 0.02217731,
0.00940356, 0.02321716, 0.00556996, 0. , 0. ,
0. , 0.03117323, 0. , 0. , 0.00734158,
0. ],
[0.03159791, 0.05680077, 0. , 0. , 0. ,
0. , 0.05907414, 0. , 0. , 0. ,
0. , 0. , 0.03110216, 0.04647615, 0. ,
0.04566741],
.
. # More similar vectors goes there
.
[0. , 0.01229661, 0.00056016, 0. , 0.03534952,
0.02654905, 0.03212402, 0. , 0. , 0. ,
0. , 0.0913604 , 0. , 0. , 0. ,
0. ]], dtype=float32)>
What am I missing? Is there any information on the Internet about training Mapping Network? Any math explanation? Got really confused :(