Huawei competition: feature separation in cross domain
- Basic operating environment: Python>=3.6.7, tensorflow=1.15
- Although the running framework of the model is tensorflow, the framework of cmnist data generation module (gen_color_mnist.py) is pytorch. Please make sure you install it.
Preparation works: Run gen_color_mnist.py to generate cmnist, and then you can find train_x.npy, train_y.npy, test_x.npy and test_y.npy in the path data_sets/cmnist/fgbg_cmnist_cpr/. Put the generated four files in the path data/.
Training:
- If you want to extract stable features in CMNIST data, please run train_stable.py. If you fall into the local optimum during training, please retrain.
- If you want to extract unstable features on the CMNIST test set, please run train_unstable.py. Before running, please make sure that the model file generated by train_stable.py had been sved in model/.