* fix code formatting

* add module init logging

* general improvements
This commit is contained in:
Łukasz Zalewski authored and GitHub committed 2021-03-06 19:43:48 +01:00
1 parent caa566dfd8
commit b45d3b31ec
13 files changed
+226 -162

No files matched your search

+29 -46
View File
@@ -15,83 +15,66 @@ echo() {
export PYTHONWARNINGS="ignore"
# Test fast_dev_run (runs for 1 train, 1 val and 1 test batch)
echo "TEST 1"
python train.py +trainer.fast_dev_run=True \
echo "fast_dev_run=true (run 1 train, val and test loop using 1 batch)"
python train.py trainer.fast_dev_run=True \
print_config=false
# Overfit to 10 bathes
echo "TEST 2"
echo "Overfit to 10 bathes"
python train.py +trainer.overfit_batches=10 \
trainer.min_epochs=20 trainer.max_epochs=20 \
trainer.min_epochs=10 trainer.max_epochs=10 \
print_config=false
# Test 1 epoch on CPU
echo "TEST 3"
echo "Train 1 epoch on CPU"
python train.py trainer.gpus=0 trainer.max_epochs=1 \
print_config=false
# Test 1 epoch on GPU
echo "TEST 4"
python train.py trainer.gpus=1 trainer.max_epochs=1 \
print_config=false
# Test on 25% of data
echo "TEST 5"
echo "Train on 25% of data"
python train.py trainer.max_epochs=1 \
+trainer.limit_train_batches=0.25 +trainer.limit_val_batches=0.25 +trainer.limit_test_batches=0.25 \
print_config=false
# Test on 15 train batches, 10 val batches, 5 test batches
echo "TEST 6"
echo "TEST 5"
echo "Train on 15 train batches, 10 val batches, 5 test batches"
python train.py trainer.max_epochs=1 \
+trainer.limit_train_batches=15 +trainer.limit_val_batches=10 +trainer.limit_test_batches=5 \
print_config=false
# Test all experiment configs
echo "TEST 6"
echo "Run all experiment configs for 2 epochs"
python train.py -m '+experiment=glob(*)' trainer.max_epochs=2 \
print_config=false
echo "TEST 7"
python train.py -m '+experiment=glob(*)' trainer.gpus=1 trainer.max_epochs=2 \
print_config=false
# Test default hydra sweep over hyperparameters (runs 4 different combinations with fast_dev_run)
echo "TEST 8"
echo "Run default hydra sweep (executes 4 different combinations with fast_dev_run=True)"
python train.py -m datamodule.batch_size=32,64 model.lr=0.001,0.003 \
+trainer.fast_dev_run=True \
trainer.fast_dev_run=True \
print_config=false
echo "TEST 8"
echo "Run with 16 bit precision"
python train.py trainer.max_epochs=1 +trainer.precision=16 \
print_config=false
# Test multiple workers and cuda pinned memory
echo "TEST 9"
python train.py trainer.gpus=1 trainer.max_epochs=2 \
datamodule.num_workers=4 datamodule.pin_memory=True \
print_config=false
echo "Run with gradient accumulation"
python train.py trainer.max_epochs=1 +trainer.accumulate_grad_batches=10 \
print_config=false
# Test 16 bit precision
echo "TEST 10"
python train.py trainer.gpus=1 trainer.max_epochs=1 precision=16 \
echo "Run validation loop twice per epoch"
python train.py trainer.max_epochs=2 +trainer.val_check_interval=0.5 \
print_config=false
# Test gradient accumulation
echo "TEST 11"
python train.py trainer.gpus=1 trainer.max_epochs=1 accumulate_grad_batches=10 \
echo "Run with CSVLogger (2 epochs)"
python train.py logger=csv trainer.min_epochs=5 trainer.max_epochs=2 \
print_config=false
# Test running validation loop twice per epoch
echo "TEST 12"
python train.py trainer.gpus=1 trainer.max_epochs=2 val_check_interval=0.5 \
print_config=false
# Test CSV logger (5 epochs)
echo "TEST 13"
python train.py logger=csv_logger trainer.min_epochs=5 trainer.max_epochs=5 trainer.gpus=1 \
print_config=false
# Test TensorBoard logger (5 epochs)
echo "TEST 14"
python train.py logger=tensorboard trainer.min_epochs=5 trainer.max_epochs=5 trainer.gpus=1 \
print_config=false
# Test mixed-precision training
echo "TEST 15"
python train.py trainer.gpus=1 trainer.max_epochs=3 \
+amp_backend='apex' amp_level='O2' \
echo "Run with TensorBoardLogger (2 epochs)"
python train.py logger=tensorboard trainer.min_epochs=5 trainer.max_epochs=2 \
print_config=false