Code to reproduce instructional material for AI for All.
If a conda session is active run:
conda deactivate
Then run:
conda env create -f environment.yml
conda activate aiforall
python linear_regression.py --lr <learning_rate> --steps <training_steps> --bias <dataset bias>
Switches:
No bias parameter: --no_bias
Examples:
No bias parameter: python linear_regression.py --lr 0.1 --no_bias
No bias parameter with biased data: python linear_regression.py --lr 0.1 --bias 3 --no_bias
Bias parameter with biased data: python linear_regression.py --lr 0.1 --bias 3
Use the slider to go through the training steps.
python logistic_regression.py --lr <learning_rate> --steps <training_steps>
Use the slider to go through the training steps.
Examples:
python logistic_regression.py
python 2D_train.py --dataset <dataset_name> --steps <training_steps> --lr <learning_rate>
Dataset names: lin, xor, half_moons
Change model in "EDIT HERE" and see how it performs
For specific xor classification visualization:
python 2D_train_xor.py --steps <training_steps> --lr <learning_rate>
python mnist_train.py
Change model in "EDIT HERE" and see how it performs
python mnist_test.py --nnet <nnet_file> --dim <size_of_plot>
Switches:
Linear model: --lin
Examples:
Linear model: python mnist_test.py --nnet models/mnist/mnist_lin.pt --dim 500 --lin
Neural network: python mnist_test.py --nnet models/mnist/mnist_lenet.pt --dim 500
Autoencoder: python train_mnist_ae.py --save_dir <nnet_directory>
Variational autoencoder: python train_mnist_ae.py --save_dir <nnet_directory> --vae
Conditional variational autoencoder: python train_mnist_ae.py --save_dir <nnet_directory> --cvae
Autoencoder:
python test_ae_gen.py --nnet models/mnist_ae/
python test_ae_gen.py --nnet models/mnist_ae_color/ --cmnist
Variational autoencoder:
python test_ae_gen.py --nnet models/mnist_vae/ --vae
python test_ae_gen.py --nnet models/mnist_vae_color/ --vae --cmnist
Conditional variational autoencoder:
python test_ae_gen.py --nnet models/mnist_cvae/ --digit <number>
python test_ae_gen.py --nnet models/mnist_cvae_color/ --digit <number> --color <color_idx> --cmnist
python visualization/visualize_mnist.py --data <dataset name>



