Skip to content
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

ENH: group arguments in --help message #146

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kaczmarj
Copy link

This commit uses argument groups to organize arguments in the --help
message. Please see
https://docs.python.org/3/library/argparse.html#argument-groups for
documentation on argument groups.

here is a snippet of the updated python main_dino.py --help message:

Temperature and teacher parameters:

  --warmup_teacher_temp WARMUP_TEACHER_TEMP
                        Initial value for the teacher temperature: 0.04 works well in most cases. Try decreasing it if the training loss
                        does not decrease.
  --teacher_temp TEACHER_TEMP
                        Final value (after linear warmup) of the teacher temperature. For most experiments, anything above 0.07 is
                        unstable. We recommend starting with the default value of 0.04 and increase this slightly if needed.
  --warmup_teacher_temp_epochs WARMUP_TEACHER_TEMP_EPOCHS
                        Number of warmup epochs for the teacher temperature (Default: 30).

Training/optimization parameters:

  --use_fp16 USE_FP16   Whether or not to use half precision for training. Improves training time and memory requirements, but can provoke
                        instability and slight decay of performance. We recommend disabling mixed precision if the loss is unstable, if
                        reducing the patch size or if training with bigger ViTs.
  --weight_decay WEIGHT_DECAY
                        Initial value of the weight decay. With ViT, a smaller value at the beginning of training works well.
  --weight_decay_end WEIGHT_DECAY_END
                        Final value of the weight decay. We use a cosine schedule for WD and using a larger decay by the end of training
                        improves performance for ViTs.

This commit uses argument groups to organize arguments in the --help
message. Please see
https://docs.python.org/3/library/argparse.html#argument-groups for
documentation on argument groups.
@facebook-github-bot
Copy link

Hi @kaczmarj!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 19, 2021
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@woctezuma
Copy link

woctezuma commented Oct 20, 2021

Interesting enhancement!

My 2 cents:

  • you should avoid removing the trailing spaces in 3 lines of the LICENSE header:

license

  • you could edit fewer lines by renaming variables:
    • parser to base_parser for instance
    • group to parser (to avoid editing many lines)

rename

In the end, rather than:

  • adding 5 lines for add_argument_group
  • editing 34 other lines,

you would be:

  • adding 5 lines for add_argument_group (that is the point of the pull request, so we cannot do better)
  • editing 1 line (to rename parser to base_parser).

I think this would make the commit clearer.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants