-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from CSMMLab/develop
Version 1.1: Added low-rank transformers and refactored code
- Loading branch information
Showing
58 changed files
with
6,655 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker run --gpus all -i --rm -t -v $(pwd)/..:/mnt scsteffen/neural_entropy:latest /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker run -t --rm -v $(pwd)/..:/mnt scsteffen/neural_entropy:latest /bin/bash -c "/mnt/docker/train_on_docker.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#mkdir /home/neuralEntropy | ||
cp -r /mnt /home/neuralEntropy | ||
|
||
cd /home/neuralEntropy/ | ||
mkdir models | ||
/usr/bin/python3 -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
|
||
sh rs_test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ numpy==1.22.2 | |
Pillow==9.0.1 | ||
tensorflow==2.8.0 | ||
pandas | ||
|
||
tensorflow_datasets | ||
tensorflow-text==2.8.* | ||
nltk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# DLRT for a 512-d transformer on the portuguese-english dataset with tau=0.01 for 100 epochs | ||
python src/speech_transformer_big_DLRT.py -t 0.01 -e 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# DLRT for a 512-d transformer on the portuguese-english dataset with tau=0.01 for 100 epochs | ||
python src/speech_transformer_big_DLRT_fr.py -r 50 -e 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# DLRT for a 128-d transformer on the portuguese-english dataset with tau=0.01 for 100 epochs | ||
python src/speech_transformer_DLRT.py -t 0.01 -e 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# DLRT for a 128-d transformer on the portuguese-english dataset with tau=0.01 for 100 epochs | ||
python src/speech_transformer_DLRT_fr.py -r 50 -e 100 |
2 changes: 1 addition & 1 deletion
2
src/run_tests_dense_reference.sh → run_scripts/run_tests_dense_reference.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Standard neural network training, for 5-layer network of widths [784,784,784,784,10] | ||
python mnist_reference.py --load 0 | ||
python src/mnist_reference.py --load 0 |
2 changes: 1 addition & 1 deletion
2
src/run_tests_fixed_rank.sh → run_scripts/run_tests_fixed_rank.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Fixed Rank training, for 5-layer network of widths [500,500,500,500,10] wit low-ranks [20,20,20,20,10] for 100 epochs. Last layer has fixed rank 10 (since we classfy 10 classes) | ||
python mnist_DLRA_fixed_rank.py -s 20 -t 1.0 -l 0 --train 1 -d 500 | ||
python src/mnist_DLRA_fixed_rank.py -s 20 -t 1.0 -l 0 --train 1 -d 500 |
4 changes: 2 additions & 2 deletions
4
src/run_tests_fixed_rank_fine_tuning.sh → ...ripts/run_tests_fixed_rank_fine_tuning.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Fixed Rank training, for 5-layer network of widths [500,500,500,500,10] wit adpative low-ranks for 10 epochs. Last layer has fixed rank 10 (since we classfy 10 classes) | ||
# Starting rank is set to 300, rank adaption tolerance is set to 0.17 | ||
python mnist_DLRA.py -s 300 -t 0.17 -l 0 -a 1 -d 500 | ||
python src/mnist_DLRA.py -s 300 -t 0.17 -l 0 -a 1 -d 500 | ||
# Fixed Rank finetuning for 100 epochs (flags -s and -t are set only to navigate into the right save-directory) | ||
python mnist_DLRA_fixed_rank.py -s 300 -t 0.17 -l 1 --train 1 -d 500 | ||
python src/mnist_DLRA_fixed_rank.py -s 300 -t 0.17 -l 1 --train 1 -d 500 |
2 changes: 1 addition & 1 deletion
2
src/run_tests_fixed_rank_train_from_prune.sh → .../run_tests_fixed_rank_train_from_prune.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Loads a dense 5-layer neural networks with width [784,784,784,784,10] | ||
# Then, the dense, full-rank weight matrices are factorized using SVD, and we keep the top 20 eigenvalue-eigenvector pairs. | ||
# The decomposed network is first evaluated (first line of the history file), and then retrained using our fixed-rank training algorithm. | ||
python mnist_DLRA_fixed_rank_retrain_from_prune.py -s 20 -l 1 --train 1 | ||
python src/mnist_DLRA_fixed_rank_retrain_from_prune.py -s 20 -l 1 --train 1 |
2 changes: 1 addition & 1 deletion
2
src/run_tests_rank_adaptive.sh → run_scripts/run_tests_rank_adaptive.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Fixed Rank training, for 5-layer network of widths [500,500,500,500,10] with adaptive low-ranks for 10 epochs. Last layer has fixed rank 10 (since we classfy 10 classes) | ||
# Starting rank is set to 150, rank adaption tolerance is set to 0.17, and max rank to 300. | ||
python mnist_DLRA.py -s 150 -t 0.17 -l 0 -a 1 -d 500 -m 300 -e 100 | ||
python src/mnist_DLRA.py -s 150 -t 0.17 -l 0 -a 1 -d 500 -m 300 -e 100 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.