首页 > 解决方案 > Stop sign flips in sklearn's PCA

问题描述

I am using PCA to visualize the evolution of a high dimensional latent space of a network during the training process. For this, I'm using PCA function from sklearn.decomposition and visualize the latent space every 10 epochs.

The problem is that during the evolution, the direction of the PCA axis flips from one frame to the other. While this is not particularly important, it ruins my animated latent space progress. I was wondering if there is a way to stop sign flips.

Below are two consecutive frames of my animation with sign flip.

enter image description here enter image description here

标签: scikit-learnpca

解决方案


尝试设置 的random_state参数sklearn.decomposition.PCA

希望能帮助到你。


推荐阅读