Previously, you saw what entanglement and the z-space means and why that's problematic in controllable generation. In this video, I'll talk about disentanglement and some ways to encourage your model to achieve it. First, I'll revisit what entangled versus disentangled z-space means, then I'll mention some of the most popular ways to encourage your model to have a disentangled z-space. Take the following z-noise vectors, v_1 and v_2, and imagine that these are coming from a disentangled z-space. Now, here on the right, I'm visualizing two dimensions of that z-space, but, of course, as you can tell from these noise vectors, there's many more than just two dimensions. Now, if this is a disentangled z-space, then each of these positions would correspond to a single feature in the output. For example, this first element, this first dimension of the noise vector would correspond to hair color, and the second dimension would correspond to hair length, and so on. If you wanted to change the hair color in a picture, you would literally just change the first element on its noise vector, or move in the z_1 direction on that z-space; and that's all you have to do, change the hair color. Then for hair length, you just move in the z_2 dimension. That's just changing these values here in the second position. Also, it's quite possible that these noise vectors are disentangled with respect to just these two different features and the rest of the values don't mean anything. This is because you typically want the size of your noise vector to be larger than the number of features you want to control. This makes it easier for your model to learn because it allows these values to take on different things over time during training. For example, if you only wanted to control these two features like hair color and hair length, then it's probably prudent to make your noise vector larger than just two-dimensions, but here you see three or more. These other values won't control a specific feature, they just help the model adapt to in training. Because the components of the noise vectors in the disentangled z-space allow you to change those features that you desire in the output, they're often called latent factors of variation, where the word latent comes from the fact that the information from the noise vectors is not seen directly on the output, but they do determine how that output looks. Sometimes you might hear noise vectors being referred more generally as latents. Then factors of variation means that these are just different factors like hair color and hair length that you want to vary, and only that one factor, that one feature that you are varying when you're varying it, not anything else. Essentially, a disentangled z-space means that there are specific indices on the noise vectors, these specific dimensions that change particular features on the output of your GAN. For instance, if a person on the image generated by a GAN has glasses or not, or whether she has a beard or some features of her hair. Each of these cells will correspond to something that you desire to change, and you can just change the values of that dimension in order to adapt glasses, beard, or hair. A crucial different between a disentangled z-space and an entangled z-space is that, here, with a disentangled z-space, when you control one of the features on the output, for example, glasses, the other features remain the same. The beard and hair will remain the same. Or if I change whether someone has a beard, the glasses and hair will stay the same. What this means is that with a disentangled z-space, you're much more likely to be able to add a beard to a person that looks very feminine without changing her hair or her facial features. One way to encourage your model to use disentangled z-spaces is to label your data and follow a similar process, the one used for conditional generation. But in this case, the information from the class is embedded in the noise vector; so you don't need this extra one-hot class information or class vector. However, using this method could be problematic for continuous classes. Imagine having to label thousands of human faces with the length of their hair. Of course, if you do do this, even having a few different classes, a few different buckets, might actually nudge your generator in the right direction. Another way to encourage your model is to use a disentangled z-space without labeling any of your examples. Instead, you add a regularization term to the loss function of your choice like BCE or W-loss to encourage your model to associate each index from the noise vectors, two different features on the output. This regularization could come from classifier gradients and they're also much more advanced techniques to do this in an unsupervised way, meaning without any labels. In summary, disentangled z-spaces let you control individual output features by corresponding certain z-values directly to desired features you want to control. To encourage your model to use disentangled noise vectors, you can use both supervised and unsupervised learning methods.