parser.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import os
  2. from cvargparse import GPUParser, Arg
  3. from chainer_addons.links import PoolingType
  4. from finetune.parser import default_factory
  5. def parse_args():
  6. parser = GPUParser(default_factory([
  7. PoolingType.as_arg("pooling",
  8. help_text="type of pre-classification pooling"),
  9. Arg("--n_components", type=int, default=1,
  10. help="Number of mixtures"),
  11. Arg("--alpha", type=float, default=0.99,
  12. help="EM update factor"),
  13. Arg("--fv_insize", type=float, default=256,
  14. help="input size for the FVE Layer"),
  15. # Arg("--normalize", action="store_true",
  16. # help="normalize features after cbil- or alpha-poolings"),
  17. # Arg("--subset", "-s", type=int, nargs="*", default=[-1], help="select specific classes"),
  18. # Arg("--no_sacred", action="store_true", help="do save outputs to sacred"),
  19. # Arg("--use_parts", action="store_true",
  20. # help="use parts, if present"),
  21. # Arg("--simple_parts", action="store_true",
  22. # help="use simple parts classifier, that only concatenates the features"),
  23. # Arg("--no_global", action="store_true",
  24. # help="use parts only, no global feature"),
  25. # Arg("--parts_in_bb", action="store_true", help="take only uniform regions where the centers are inside the bounding box"),
  26. # Arg("--rnd_select", action="store_true", help="hide random uniform regions of the image"),
  27. # Arg("--recurrent", action="store_true", help="observe all parts in recurrent manner instead of the whole image at once"),
  28. # ## AlphaPooling options
  29. # Arg("--init_alpha", type=int, default=1, help="initial parameter for alpha pooling"),
  30. # Arg("--kappa", type=float, default=1., help="Learning rate factor for alpha pooling"),
  31. # Arg("--switch_epochs", type=int, default=0, help="train alpha pooling layer and the rest of the network alternating")
  32. ])
  33. )
  34. parser.init_logger()
  35. return parser.parse_args()