Skip to content

Commit

Permalink
fix: bump epochs batch size to larger ones, update READMEs (#155)
Browse files Browse the repository at this point in the history
* fix: bump epochs batch size to larger ones

* fix: bump each epoch length to 1000

* fix: install tensorboard

* chore: up readmes
  • Loading branch information
ydcjeff committed Jun 7, 2021
1 parent 7a9e176 commit 2145a85
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 38 deletions.
1 change: 1 addition & 0 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ image_dataset_viz
pytest
transformers
datasets
tensorboard
32 changes: 28 additions & 4 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ run_simple() {
for dir in $(find ./dist-tests/*-simple -type d)
do
cd $dir
python main.py --data_path ~/data
python main.py --data_path ~/data \
--train_batch_size 4 \
--eval_batch_size 4 \
--num_workers 2 \
--max_epochs 2 \
--train_epoch_length 4 \
--eval_epoch_length 4
cd $CWD
done
}
Expand All @@ -28,7 +34,13 @@ run_all() {
do
cd $dir
pytest -vra --color=yes --tb=short test_*.py
python main.py --data_path ~/data
python main.py --data_path ~/data \
--train_batch_size 4 \
--eval_batch_size 4 \
--num_workers 2 \
--max_epochs 2 \
--train_epoch_length 4 \
--eval_epoch_length 4
cd $CWD
done
}
Expand All @@ -39,7 +51,13 @@ run_launch() {
cd $dir
python -m torch.distributed.launch \
--nproc_per_node 2 --use_env \
main.py --backend gloo --data_path ~/data
main.py --backend gloo --data_path ~/data \
--train_batch_size 4 \
--eval_batch_size 4 \
--num_workers 2 \
--max_epochs 2 \
--train_epoch_length 4 \
--eval_epoch_length 4
cd $CWD
done
}
Expand All @@ -49,7 +67,13 @@ run_spawn() {
do
cd $dir
python main.py --data_path ~/data \
--nproc_per_node 2 --backend gloo
--nproc_per_node 2 --backend gloo \
--train_batch_size 4 \
--eval_batch_size 4 \
--num_workers 2 \
--max_epochs 2 \
--train_epoch_length 4 \
--eval_epoch_length 4
cd $CWD
done
}
Expand Down
12 changes: 6 additions & 6 deletions src/templates/template-common/config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
seed: 666
data_path: ./
train_batch_size: 4
eval_batch_size: 4
num_workers: 2
max_epochs: 2
train_epoch_length: 4
eval_epoch_length: 4
train_batch_size: 32
eval_batch_size: 32
num_workers: 4
max_epochs: 20
train_epoch_length: 1000
eval_epoch_length: 1000
use_amp: false
debug: false

Expand Down
6 changes: 5 additions & 1 deletion src/templates/template-text-classification/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Template by Code-Generator
[![Code-Generator](https://badgen.net/badge/Template%20by/Code-Generator/ee4c2c?labelColor=eaa700)](https://github.com/pytorch-ignite/code-generator)

# Text Classification Template

This is the text classification template by Code-Generator using `bert-base-uncased` model from HuggingFace Transformers and `imdb` dataset from HuggingFace datasets and training is powered by PyTorch and PyTorch-Ignite.

## Getting Started

Expand Down
12 changes: 6 additions & 6 deletions src/templates/template-text-classification/config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
seed: 666
data_path: ./
train_batch_size: 4
eval_batch_size: 4
num_workers: 2
max_epochs: 2
train_epoch_length: 4
eval_epoch_length: 4
train_batch_size: 32
eval_batch_size: 32
num_workers: 4
max_epochs: 20
train_epoch_length: 1000
eval_epoch_length: 1000
use_amp: false
debug: false
model: bert-base-uncased
Expand Down
6 changes: 5 additions & 1 deletion src/templates/template-vision-classification/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Template by Code-Generator
[![Code-Generator](https://badgen.net/badge/Template%20by/Code-Generator/ee4c2c?labelColor=eaa700)](https://github.com/pytorch-ignite/code-generator)

# Image Classification Template by Code-Generator

This is the image classification template by Code-Generator using `resnet18` model and `cifar10` dataset from TorchVision and training is powered by PyTorch and PyTorch-Ignite.

## Getting Started

Expand Down
12 changes: 6 additions & 6 deletions src/templates/template-vision-classification/config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
seed: 666
data_path: ./
train_batch_size: 4
eval_batch_size: 4
num_workers: 2
max_epochs: 2
train_epoch_length: 4
eval_epoch_length: 4
train_batch_size: 32
eval_batch_size: 32
num_workers: 4
max_epochs: 20
train_epoch_length: 1000
eval_epoch_length: 1000
lr: 0.0001
use_amp: false
debug: false
Expand Down
6 changes: 5 additions & 1 deletion src/templates/template-vision-dcgan/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Template by Code-Generator
[![Code-Generator](https://badgen.net/badge/Template%20by/Code-Generator/ee4c2c?labelColor=eaa700)](https://github.com/pytorch-ignite/code-generator)

# DCGAN Template

This is the dcgan template by Code-Generator using `dcgan` model and `cifar10` dataset from TorchVision and training is powered by PyTorch and PyTorch-Ignite.

## Getting Started

Expand Down
12 changes: 6 additions & 6 deletions src/templates/template-vision-dcgan/config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
seed: 666
data_path: ./
train_batch_size: 4
eval_batch_size: 4
num_workers: 2
max_epochs: 2
train_epoch_length: 4
eval_epoch_length: 4
train_batch_size: 32
eval_batch_size: 32
num_workers: 4
max_epochs: 20
train_epoch_length: 1000
eval_epoch_length: 1000
lr: 0.0001
use_amp: false
debug: false
Expand Down
6 changes: 5 additions & 1 deletion src/templates/template-vision-segmentation/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Template by Code-Generator
[![Code-Generator](https://badgen.net/badge/Template%20by/Code-Generator/ee4c2c?labelColor=eaa700)](https://github.com/pytorch-ignite/code-generator)

# Segmentation Template

This is the segmentation template by Code-Generator using `deeplabv3_resnet101` and `cifar10` dataset from TorchVision and training is powered by PyTorch and PyTorch-Ignite.

## Getting Started

Expand Down
12 changes: 6 additions & 6 deletions src/templates/template-vision-segmentation/config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
seed: 666
data_path: ./
train_batch_size: 4
eval_batch_size: 4
num_workers: 2
max_epochs: 2
train_epoch_length: 4
eval_epoch_length: 4
train_batch_size: 32
eval_batch_size: 32
num_workers: 4
max_epochs: 20
train_epoch_length: 1000
eval_epoch_length: 1000
lr: 0.007
use_amp: false
debug: false
Expand Down

0 comments on commit 2145a85

Please sign in to comment.