10000 Include batch_size as an argument, instead of sample_rate by ashkan-software · Pull Request #473 · pytorch/opacus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Include batch_size as an argument, instead of sample_rate #473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ commands:
echo "Using $(python -V) ($(which python))"
echo "Using $(pip -V) ($(which pip))"
pip install tensorboard
python examples/cifar10.py --lr 0.1 --sigma 1.5 -c 10 --sample-rate 0.04 --epochs 10 --data-root runs/cifar10/data --log-dir runs/cifar10/logs --device <<parameters.device>>
python examples/cifar10.py --lr 0.1 --sigma 1.5 -c 10 --batch-size 2000 --epochs 10 --data-root runs/cifar10/data --log-dir runs/cifar10/logs --device <<parameters.device>>
python -c "import torch; model = torch.load('model_best.pth.tar'); exit(0) if (model['best_acc1']>0.4 and model['best_acc1']<0.49) else exit(1)"
when: always
- store_test_results:
Expand Down
10 changes: 5 additions & 5 deletions examples/cifar10.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def main():

train_loader = torch.utils.data.DataLoader(
train_dataset,
batch_size=int(args.sample_rate * len(train_dataset)),
batch_size=args.batch_size,
generator=generator,
num_workers=args.workers,
pin_memory=True,
Expand Down Expand Up @@ -421,11 +421,11 @@ def parse_args():
"using Data Parallel or Distributed Data Parallel",
)
parser.add_argument(
"--sample-rate",
default=0.04,
"--batch-size",
default=2000,
type=float,
metavar="SR",
help="sample rate used for batch construction (default: 0.005)",
metavar="N",
help="train bacth size",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be change this to approximate batch size in the help string, since the batch size will not necessarily be 2K.

)
parser.add_argument(
"--lr",
Expand Down
< 399F /div>
0