├── dev ├── __init__.py ├── packaging │ ├── vissl_conda │ │ ├── .gitignore │ │ ├── upload.sh │ │ ├── README.md │ │ └── build_all_conda.sh │ ├── vissl_pip │ │ ├── .gitignore │ │ ├── after.sh │ │ ├── test │ │ │ ├── README.md │ │ │ ├── run.sh │ │ │ └── test.sh │ │ ├── to_pypi.sh │ │ └── go.sh │ ├── README.md │ ├── apex_pip │ │ ├── after.sh │ │ └── go.sh │ └── apex_conda │ │ ├── go.sh │ │ ├── upload.sh │ │ └── README.md └── benchmark_suite │ └── benchmark_suite_scheduler_defaults.json ├── tests ├── test_data │ ├── __init__.py │ ├── test_img0.jpg │ ├── test_img1.jpg │ ├── test_img2.jpg │ └── test_img3.jpg ├── README.md └── __init__.py ├── extra_scripts ├── datasets │ └── __init__.py └── __init__.py ├── .github ├── framework_features.png ├── framework_components.png ├── logo │ ├── Logo_Color-Light_BG.jpg │ └── Logo_Color_Light_BG.png ├── CODE_OF_CONDUCT.md └── ISSUE_TEMPLATE │ ├── documentation.md │ ├── new-ssl-approach.md │ └── new-benchmark.md ├── website ├── static │ └── img │ │ ├── favicon.ico │ │ ├── modular2.png │ │ ├── oss_logo.png │ │ ├── colab_icon.png │ │ ├── visslfavicon.png │ │ ├── Logo_Color_Light_BG.png │ │ └── pytorch.svg ├── sidebars.json ├── .gitignore └── package.json ├── configs ├── config │ ├── pretrain │ │ ├── pirl │ │ │ ├── epochs │ │ │ │ └── epochs_200.yaml │ │ │ └── models │ │ │ │ ├── resnet50_w2.yaml │ │ │ │ └── resnet50_w4.yaml │ │ ├── simclr │ │ │ ├── optimization │ │ │ │ ├── bs32_2nodes.yaml │ │ │ │ ├── bs64_1node.yaml │ │ │ │ ├── bs64_2nodes.yaml │ │ │ │ ├── bs64_4nodes.yaml │ │ │ │ ├── bs64_8nodes.yaml │ │ │ │ ├── bs32_16nodes.yaml │ │ │ │ ├── bs64_16nodes.yaml │ │ │ │ ├── bs64_32nodes.yaml │ │ │ │ ├── bs64_40nodes.yaml │ │ │ │ ├── bs64_48nodes.yaml │ │ │ │ └── bs64_64nodes.yaml │ │ │ └── models │ │ │ │ ├── resnet50_w2.yaml │ │ │ │ ├── resnet50_w3.yaml │ │ │ │ ├── resnet50_w4.yaml │ │ │ │ ├── regnet400mf.yaml │ │ │ │ ├── resnext50.yaml │ │ │ │ └── resnext101.yaml │ │ ├── swav │ │ │ ├── optimization │ │ │ │ ├── bs32_16nodes.yaml │ │ │ │ ├── bs40_8nodes.yaml │ │ │ │ ├── bs64_8nodes.yaml │ │ │ │ ├── bs64_4gpu.yaml │ │ │ │ ├── bs64_8node_cos_1restart_full.yaml │ │ │ │ ├── bs64_8node_cos_1restart_half.yaml │ │ │ │ ├── bs64_8node_cos_1restart_half_adaptive.yaml │ │ │ │ └── bs64_8node_cos_1restart_full_adaptive.yaml │ │ │ ├── heads │ │ │ │ ├── d10444_d8192_d8192_d256_proto16k.yaml │ │ │ │ └── d7392_d8192_d8192_d256_proto16k.yaml │ │ │ ├── models │ │ │ │ ├── regnet256Gf_1.yaml │ │ │ │ ├── regnet400mf.yaml │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ ├── resnext50.yaml │ │ │ │ └── resnext101.yaml │ │ │ └── transforms │ │ │ │ ├── multicrop_2x224.yaml │ │ │ │ ├── multicrop_6crop_6x160.yaml │ │ │ │ ├── multicrop_2x224_4x96.yaml │ │ │ │ ├── multicrop_6crop_2x160_4x96.yaml │ │ │ │ └── multicrop_6crop_2x224_4x96.yaml │ │ ├── npid │ │ │ ├── models │ │ │ │ ├── resnet50.yaml │ │ │ │ ├── resnet101.yaml │ │ │ │ ├── resnet50_w2.yaml │ │ │ │ └── resnet50_w3.yaml │ │ │ └── optimizations │ │ │ │ └── bs32_4node_cosineLR.yaml │ │ ├── jigsaw │ │ │ └── optimization │ │ │ │ ├── bs32_8gpu_yfcc_10ep.yaml │ │ │ │ └── bs32_4nodes.yaml │ │ ├── datasets │ │ │ ├── yfcc100m.yaml │ │ │ └── imagenet.yaml │ │ └── deepcluster_v2 │ │ │ └── transforms │ │ │ └── multicrop_2x160_4x96.yaml │ ├── benchmark │ │ ├── semi_supervised │ │ │ ├── imagenet1k │ │ │ │ ├── dataset │ │ │ │ │ ├── simclr_in1k_per10.yaml │ │ │ │ │ ├── balanced_in1k_per05.yaml │ │ │ │ │ ├── balanced_in1k_per20.yaml │ │ │ │ │ ├── balanced_in1k_per50.yaml │ │ │ │ │ ├── simclr_in1k_per01.yaml │ │ │ │ │ ├── pirl_in1k_per01.yaml │ │ │ │ │ ├── pirl_in1k_per10.yaml │ │ │ │ │ ├── random_in1k_per05.yaml │ │ │ │ │ ├── random_in1k_per20.yaml │ │ │ │ │ └── random_in1k_per50.yaml │ │ │ │ └── models │ │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ │ ├── resnet50_w2.yaml │ │ │ │ │ ├── resnet50_w3.yaml │ │ │ │ │ ├── resnext101.yaml │ │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ │ ├── regnet8Gf.yaml │ │ │ │ │ ├── resnext50.yaml │ │ │ │ │ ├── regnet8Gf_swav_head.yaml │ │ │ │ │ ├── regnet16Gf_swav_head.yaml │ │ │ │ │ ├── regnet32Gf_swav_head.yaml │ │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ │ ├── resnet50_w4.yaml │ │ │ │ │ ├── regnet64Gf_3_swav_head.yaml │ │ │ │ │ ├── regnet64Gf_3.yaml │ │ │ │ │ ├── resnext101_32x16d.yaml │ │ │ │ │ └── regnet128Gf_swav_head.yaml │ │ │ └── places205 │ │ │ │ ├── models │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ ├── resnext101.yaml │ │ │ │ ├── regnet8Gf.yaml │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ ├── resnext50.yaml │ │ │ │ ├── regnet16Gf_swav_head.yaml │ │ │ │ ├── regnet32Gf_swav_head.yaml │ │ │ │ ├── regnet8Gf_swav_head.yaml │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ ├── regnet64Gf_3_swav_head.yaml │ │ │ │ ├── regnet64Gf_3.yaml │ │ │ │ ├── resnext101_32x16d.yaml │ │ │ │ └── regnet128Gf_swav_head.yaml │ │ │ │ └── dataset │ │ │ │ ├── random_places205_per01.yaml │ │ │ │ ├── random_places205_per05.yaml │ │ │ │ ├── random_places205_per10.yaml │ │ │ │ ├── random_places205_per20.yaml │ │ │ │ ├── random_places205_per50.yaml │ │ │ │ ├── balanced_places205_per01.yaml │ │ │ │ ├── balanced_places205_per05.yaml │ │ │ │ ├── balanced_places205_per10.yaml │ │ │ │ └── balanced_places205_per20.yaml │ │ ├── object_detection │ │ │ ├── voc07 │ │ │ │ ├── pirl_npid │ │ │ │ │ └── rn50_transfer_voc07_pirl_npid.yaml │ │ │ │ ├── rn50_w2_transfer_voc07_detectron2_e2e.yaml │ │ │ │ └── rn50_w3_transfer_voc07_detectron2_e2e.yaml │ │ │ ├── voc0712 │ │ │ │ ├── pirl_npid │ │ │ │ │ └── rn50_transfer_voc0712_npid_pirl.yaml │ │ │ │ ├── simclr_swav │ │ │ │ │ └── rn50_transfer_voc0712_simclr_swav.yaml │ │ │ │ ├── iccv19 │ │ │ │ │ ├── rn50_w2_transfer_voc0712_detectron2_e2e.yaml │ │ │ │ │ ├── rn50_w3_transfer_voc0712_detectron2_e2e.yaml │ │ │ │ │ └── rn50_transfer_voc0712_detectron2_e2e.yaml │ │ │ │ ├── mocoV2 │ │ │ │ │ ├── rn50_w2_transfer_voc0712_detectron2_e2e.yaml │ │ │ │ │ └── rn50_w3_transfer_voc0712_detectron2_e2e.yaml │ │ │ │ └── cvpr21_scale │ │ │ │ │ └── RX101-32x8d_VOC0712 │ │ │ │ │ └── d2_defaults_BGR.yaml │ │ │ └── COCOInstance │ │ │ │ └── R50_C4_COCO │ │ │ │ ├── sBNExtraNorm_precBN_BGR_lrpt02_warm50_2x.yaml │ │ │ │ └── d2_defaults.yaml │ │ ├── fulltune │ │ │ ├── imagenet1k │ │ │ │ ├── models │ │ │ │ │ ├── resnext101.yaml │ │ │ │ │ ├── regnet256Gf.yaml │ │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ │ ├── regnet64Gf.yaml │ │ │ │ │ ├── resnet50_w2.yaml │ │ │ │ │ ├── resnet50_w3.yaml │ │ │ │ │ ├── regnet32Gf_bn.yaml │ │ │ │ │ ├── regnet8Gf.yaml │ │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ │ ├── regnet16Gf_bn.yaml │ │ │ │ │ ├── resnext101_32x4d.yaml │ │ │ │ │ ├── resnext50.yaml │ │ │ │ │ ├── resnext101_32x8d.yaml │ │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ │ ├── regnet16Gf_swav_d3024_d4096.yaml │ │ │ │ │ ├── regnet16Gf_swav_d3024_d4096_d4096.yaml │ │ │ │ │ ├── resnet50_w4.yaml │ │ │ │ │ ├── regnet16Gf_swav_d3024_d4096_lastBN.yaml │ │ │ │ │ ├── regnet16Gf_swav_d3024_d4096_noNorm.yaml │ │ │ │ │ ├── regnet16Gf_swav_d3024_d4096_lastBN_noNorm.yaml │ │ │ │ │ ├── regnet64Gf_3.yaml │ │ │ │ │ ├── regnet256Gf_1.yaml │ │ │ │ │ ├── resnext101_32x16d.yaml │ │ │ │ │ └── regnet128Gf_swav_head.yaml │ │ │ │ ├── datasets │ │ │ │ │ ├── imagenet_1k.yaml │ │ │ │ │ ├── imagenet_1k_10percent.yaml │ │ │ │ │ └── imagenet_1k_1percent.yaml │ │ │ │ └── transforms │ │ │ │ │ ├── swav_train_only.yaml │ │ │ │ │ ├── fixnet_320.yaml │ │ │ │ │ ├── fixnet_384.yaml │ │ │ │ │ ├── fixnet_320_swav.yaml │ │ │ │ │ └── fixnet_384_swav.yaml │ │ │ └── places205 │ │ │ │ └── models │ │ │ │ ├── resnext101.yaml │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ ├── regnet64Gf.yaml │ │ │ │ ├── regnet256Gf.yaml │ │ │ │ ├── resnet50_w2.yaml │ │ │ │ ├── resnet50_w3.yaml │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ ├── regnet8Gf.yaml │ │ │ │ ├── resnext101_32x4d.yaml │ │ │ │ ├── resnext50.yaml │ │ │ │ ├── resnext101_32x8d.yaml │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ ├── resnet50_w4.yaml │ │ │ │ ├── regnet64Gf_3.yaml │ │ │ │ └── resnext101_32x16d.yaml │ │ ├── linear_image_classification │ │ │ ├── imagenet1k │ │ │ │ ├── semi_sup_datasets │ │ │ │ │ ├── simclr_in1k_per01.yaml │ │ │ │ │ ├── simclr_in1k_per10.yaml │ │ │ │ │ ├── pirl_in1k_per01.yaml │ │ │ │ │ └── pirl_in1k_per10.yaml │ │ │ │ ├── optimizers │ │ │ │ │ ├── moco.yaml │ │ │ │ │ └── vit_high_lr.yaml │ │ │ │ ├── models │ │ │ │ │ ├── regnet400MF.yaml │ │ │ │ │ ├── efficientNet_B0.yaml │ │ │ │ │ └── alexnet_rotnet.yaml │ │ │ │ └── transforms │ │ │ │ │ └── resize320_224.yaml │ │ │ ├── openimages │ │ │ │ └── models │ │ │ │ │ └── regnet128Gf.yaml │ │ │ ├── places205 │ │ │ │ ├── semi_sup_datasets │ │ │ │ │ ├── balanced_places205_per01.yaml │ │ │ │ │ ├── balanced_places205_per05.yaml │ │ │ │ │ ├── balanced_places205_per10.yaml │ │ │ │ │ ├── balanced_places205_per20.yaml │ │ │ │ │ ├── random_places205_per01.yaml │ │ │ │ │ ├── random_places205_per05.yaml │ │ │ │ │ ├── random_places205_per10.yaml │ │ │ │ │ ├── random_places205_per20.yaml │ │ │ │ │ └── random_places205_per50.yaml │ │ │ │ ├── models │ │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ │ └── alexnet_rotnet.yaml │ │ │ │ └── transforms │ │ │ │ │ └── resize320_224.yaml │ │ │ ├── voc07 │ │ │ │ ├── models │ │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ │ ├── alexnet_rotnet.yaml │ │ │ │ │ ├── regnet64Gf_3.yaml │ │ │ │ │ ├── regnet256Gf_1.yaml │ │ │ │ │ ├── alexnet_deepcluster.yaml │ │ │ │ │ ├── resnet50_w4.yaml │ │ │ │ │ ├── resnet50_w2.yaml │ │ │ │ │ └── resnet50_w3.yaml │ │ │ │ └── transforms │ │ │ │ │ ├── resize320_224.yaml │ │ │ │ │ └── resize640_224.yaml │ │ │ ├── transforms │ │ │ │ └── swav_train_only.yaml │ │ │ ├── clevr_dist │ │ │ │ └── models │ │ │ │ │ ├── regnet8Gf.yaml │ │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ │ └── regnet64Gf.yaml │ │ │ ├── gtsrb │ │ │ │ └── models │ │ │ │ │ ├── regnet8Gf.yaml │ │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ │ ├── regnet64Gf.yaml │ │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ │ └── regnet256Gf.yaml │ │ │ ├── kitti_dist │ │ │ │ └── models │ │ │ │ │ ├── regnet8Gf.yaml │ │ │ │ │ └── regnet32Gf.yaml │ │ │ ├── clevr_count │ │ │ │ └── models │ │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ │ ├── regnet8Gf.yaml │ │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ │ └── regnet64Gf.yaml │ │ │ ├── dsprites │ │ │ │ └── models │ │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ │ ├── regnet8Gf.yaml │ │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ │ └── regnet64Gf.yaml │ │ │ ├── euro_sat │ │ │ │ └── models │ │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ │ ├── regnet8Gf.yaml │ │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ │ └── regnet64Gf.yaml │ │ │ ├── ucf101 │ │ │ │ └── models │ │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ │ └── regnet8Gf.yaml │ │ │ └── inaturalist18 │ │ │ │ └── transforms │ │ │ │ └── resize320_224.yaml │ │ ├── nearest_neighbor │ │ │ └── models │ │ │ │ ├── supervised │ │ │ │ └── resnext50.yaml │ │ │ │ ├── swav │ │ │ │ ├── regnet16Gf.yaml │ │ │ │ ├── regnet32Gf.yaml │ │ │ │ ├── regnet8Gf.yaml │ │ │ │ ├── regnet128Gf.yaml │ │ │ │ ├── regnet16Gf_d256.yaml │ │ │ │ ├── regnet32Gf_d256.yaml │ │ │ │ ├── regnet8Gf_d256.yaml │ │ │ │ ├── regnet128Gf_d256.yaml │ │ │ │ ├── resnet50_w2.yaml │ │ │ │ ├── resnet50_w3.yaml │ │ │ │ ├── resnet50_w4.yaml │ │ │ │ ├── regnet64Gf_3.yaml │ │ │ │ ├── regnet64Gf_3_d256.yaml │ │ │ │ ├── resnext50.yaml │ │ │ │ ├── resnext_d256.yaml │ │ │ │ └── resnext101.yaml │ │ │ │ └── simclr │ │ │ │ ├── resnet50_w2.yaml │ │ │ │ ├── resnet50_w3.yaml │ │ │ │ ├── resnet50_w4.yaml │ │ │ │ ├── resnext50.yaml │ │ │ │ └── resnext101.yaml │ │ └── low_shot_transfer │ │ │ └── places205 │ │ │ └── models │ │ │ ├── regnet8Gf.yaml │ │ │ ├── regnet16Gf.yaml │ │ │ ├── regnet32Gf.yaml │ │ │ ├── regnet128Gf.yaml │ │ │ └── regnet64Gf_3.yaml │ ├── __init__.py │ ├── feature_extraction │ │ ├── with_head │ │ │ ├── rn50_supervised.yaml │ │ │ ├── rn50_swav.yaml │ │ │ ├── rn50_simclr.yaml │ │ │ └── regnet128Gf_swav.yaml │ │ └── trunk_only │ │ │ ├── rn50_res5.yaml │ │ │ ├── regnet16Gf_layers.yaml │ │ │ ├── rn50_32x8d_layers.yaml │ │ │ ├── rn50_layers.yaml │ │ │ └── regnet128Gf_res5.yaml │ ├── debugging │ │ └── benchmark │ │ │ ├── fine_tuning │ │ │ └── models │ │ │ │ └── regnet16Gf_mlp.yaml │ │ │ └── linear_image_classification │ │ │ └── models │ │ │ ├── regnet16Gf_mlp.yaml │ │ │ └── regnet16Gf_eval_mlp.yaml │ ├── test │ │ └── integration_test │ │ │ └── models │ │ │ ├── finetune_regnet_fsdp.yaml │ │ │ ├── eval_regnet_fsdp.yaml │ │ │ └── swav_regnet_fsdp.yaml │ └── extract_cluster │ │ └── swav │ │ └── models │ │ └── regnet16Gf.yaml └── __init__.py ├── docs ├── source │ ├── _static │ │ └── img │ │ │ ├── vissl-logo.png │ │ │ ├── train_flowchart.png │ │ │ ├── train_svm_flowchart.png │ │ │ ├── extract_features_flowchart.png │ │ │ └── nearest_neighbor_flowchart.png │ ├── contacts.rst │ ├── api │ │ ├── index.rst │ │ ├── engine.rst │ │ ├── meters.rst │ │ ├── models.rst │ │ └── trainer.rst │ └── flowcharts │ │ ├── train_workflow.rst │ │ ├── svm_workflow.rst │ │ ├── extract_workflow.rst │ │ └── nearest_neighbor.rst ├── Makefile └── requirements.txt ├── MANIFEST.in ├── tools ├── __init__.py └── perf_measurement │ └── __init__.py ├── .circleci └── README.md ├── hydra_plugins └── vissl_plugin │ ├── __init__.py │ └── vissl_plugin.py ├── vissl ├── __init__.py ├── utils │ ├── __init__.py │ ├── svm_utils │ │ └── __init__.py │ ├── instance_retrieval_utils │ │ └── __init__.py │ ├── README.md │ └── visualize.py ├── data │ └── datasets │ │ └── __init__.py ├── models │ ├── trunks │ │ └── resnet.py │ └── __init__.py ├── losses │ └── __init__.py ├── meters │ └── __init__.py ├── optimizers │ ├── __init__.py │ └── param_scheduler │ │ └── __init__.py └── engines │ └── __init__.py ├── requirements.txt └── setup.cfg /dev/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_data/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /extra_scripts/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dev/packaging/vissl_conda/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | -------------------------------------------------------------------------------- /dev/packaging/vissl_pip/.gitignore: -------------------------------------------------------------------------------- 1 | output 2 | -------------------------------------------------------------------------------- /tests/test_data/test_img0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/tests/test_data/test_img0.jpg -------------------------------------------------------------------------------- /tests/test_data/test_img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/tests/test_data/test_img1.jpg -------------------------------------------------------------------------------- /tests/test_data/test_img2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/tests/test_data/test_img2.jpg -------------------------------------------------------------------------------- /tests/test_data/test_img3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/tests/test_data/test_img3.jpg -------------------------------------------------------------------------------- /.github/framework_features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/.github/framework_features.png -------------------------------------------------------------------------------- /website/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/website/static/img/favicon.ico -------------------------------------------------------------------------------- /website/static/img/modular2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/website/static/img/modular2.png -------------------------------------------------------------------------------- /website/static/img/oss_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/website/static/img/oss_logo.png -------------------------------------------------------------------------------- /.github/framework_components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/.github/framework_components.png -------------------------------------------------------------------------------- /website/static/img/colab_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/website/static/img/colab_icon.png -------------------------------------------------------------------------------- /.github/logo/Logo_Color-Light_BG.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/.github/logo/Logo_Color-Light_BG.jpg -------------------------------------------------------------------------------- /.github/logo/Logo_Color_Light_BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/.github/logo/Logo_Color_Light_BG.png -------------------------------------------------------------------------------- /website/static/img/visslfavicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/website/static/img/visslfavicon.png -------------------------------------------------------------------------------- /configs/config/pretrain/pirl/epochs/epochs_200.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | OPTIMIZER: 4 | num_epochs: 200 5 | -------------------------------------------------------------------------------- /docs/source/_static/img/vissl-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/docs/source/_static/img/vissl-logo.png -------------------------------------------------------------------------------- /docs/source/_static/img/train_flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/docs/source/_static/img/train_flowchart.png -------------------------------------------------------------------------------- /website/static/img/Logo_Color_Light_BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/website/static/img/Logo_Color_Light_BG.png -------------------------------------------------------------------------------- /docs/source/_static/img/train_svm_flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/docs/source/_static/img/train_svm_flowchart.png -------------------------------------------------------------------------------- /docs/source/_static/img/extract_features_flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/docs/source/_static/img/extract_features_flowchart.png -------------------------------------------------------------------------------- /docs/source/_static/img/nearest_neighbor_flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Namsik-Yoon/vissl/master/docs/source/_static/img/nearest_neighbor_flowchart.png -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | ## Unit Tests 2 | 3 | To run the unittests, do: 4 | ``` 5 | cd vissl && pip install -e .[dev] 6 | python -m unittest discover -v -s tests 7 | ``` 8 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | global-exclude *.pyc 2 | global-exclude __pycache__ 3 | recursive-include configs/ *.yaml 4 | include vissl/config/defaults.yaml 5 | include requirements.txt 6 | -------------------------------------------------------------------------------- /dev/packaging/README.md: -------------------------------------------------------------------------------- 1 | To distribute new conda and pip packages for vissl, run the procedures in vissl_conda and vissl_pip after updating the version number of vissl to the new one. 2 | -------------------------------------------------------------------------------- /docs/source/contacts.rst: -------------------------------------------------------------------------------- 1 | Contact 2 | ======== 3 | 4 | 5 | If you want to contact the team about something else than code, like an idea for collaboration, drop us an email at vissl@fb.com. 6 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/dataset/simclr_in1k_per10.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["google-imagenet1k-per10"] 6 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/dataset/balanced_in1k_per05.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["balanced-imagenet1k-per05"] 6 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/dataset/balanced_in1k_per20.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["balanced-imagenet1k-per20"] 6 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/dataset/balanced_in1k_per50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["balanced-imagenet1k-per50"] 6 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/voc07/pirl_npid/rn50_transfer_voc07_pirl_npid.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../rn50_transfer_voc07_detectron2_e2e.yaml" 2 | SOLVER: 3 | WARMUP_ITERS: 1000 4 | BASE_LR: 0.002 5 | -------------------------------------------------------------------------------- /configs/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | -------------------------------------------------------------------------------- /tools/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | -------------------------------------------------------------------------------- /configs/config/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | -------------------------------------------------------------------------------- /extra_scripts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | -------------------------------------------------------------------------------- /.circleci/README.md: -------------------------------------------------------------------------------- 1 | # CircleCI for VISSL 2 | 3 | We test every PR, commit on CircleCI (cpu and gpu tests) in CUDA 10.2, pip, python3 environment. See https://app.circleci.com/pipelines/github/facebookresearch/vissl . 4 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/voc0712/pirl_npid/rn50_transfer_voc0712_npid_pirl.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../iccv19/rn50_transfer_voc0712_detectron2_e2e.yaml" 2 | SOLVER: 3 | WARMUP_ITERS: 1000 4 | BASE_LR: 0.002 5 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/dataset/simclr_in1k_per01.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["google-imagenet1k-per01"] 6 | DROP_LAST: True 7 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/optimization/bs32_2nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 32 6 | DISTRIBUTED: 7 | NUM_NODES: 2 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/optimization/bs64_1node.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 64 6 | DISTRIBUTED: 7 | NUM_NODES: 1 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/optimization/bs64_2nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 64 6 | DISTRIBUTED: 7 | NUM_NODES: 2 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/optimization/bs64_4nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 64 6 | DISTRIBUTED: 7 | NUM_NODES: 4 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/optimization/bs64_8nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 64 6 | DISTRIBUTED: 7 | NUM_NODES: 8 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/optimization/bs32_16nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 32 6 | DISTRIBUTED: 7 | NUM_NODES: 16 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/optimization/bs40_8nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 40 6 | DISTRIBUTED: 7 | NUM_NODES: 8 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/optimization/bs64_8nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 64 6 | DISTRIBUTED: 7 | NUM_NODES: 8 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /tools/perf_measurement/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/optimization/bs32_16nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 32 6 | DISTRIBUTED: 7 | NUM_NODES: 16 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/optimization/bs64_16nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 64 6 | DISTRIBUTED: 7 | NUM_NODES: 16 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/optimization/bs64_32nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 64 6 | DISTRIBUTED: 7 | NUM_NODES: 32 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/optimization/bs64_40nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 64 6 | DISTRIBUTED: 7 | NUM_NODES: 40 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/optimization/bs64_48nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 64 6 | DISTRIBUTED: 7 | NUM_NODES: 48 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/optimization/bs64_64nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 64 6 | DISTRIBUTED: 7 | NUM_NODES: 64 8 | NUM_PROC_PER_NODE: 8 9 | -------------------------------------------------------------------------------- /hydra_plugins/vissl_plugin/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | -------------------------------------------------------------------------------- /vissl/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | __version__ = "0.1.5" 7 | -------------------------------------------------------------------------------- /website/sidebars.json: -------------------------------------------------------------------------------- 1 | { 2 | "docs": { 3 | "Docusaurus": ["doc1"], 4 | "First Category": ["doc2"], 5 | "Second Category": ["doc3"] 6 | }, 7 | "docs-other": { 8 | "First Category": ["doc4", "doc5"] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/voc0712/simclr_swav/rn50_transfer_voc0712_simclr_swav.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "../mocoV2/rn50_transfer_voc07_detectron2_e2e.yaml" 2 | SOLVER: 3 | WARMUP_ITERS: 1000 4 | WARMUP_FACTOR: 0.3333 5 | BASE_LR: 0.10 6 | -------------------------------------------------------------------------------- /configs/config/pretrain/npid/models/resnet50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | HEAD: 9 | PARAMS: [["mlp", {"dims": [2048, 128]}]] 10 | -------------------------------------------------------------------------------- /docs/source/api/index.rst: -------------------------------------------------------------------------------- 1 | API Documentation 2 | ==================== 3 | 4 | .. toctree:: 5 | 6 | data 7 | engine 8 | meters 9 | models 10 | losses 11 | hooks 12 | optimizers 13 | trainer 14 | utils 15 | -------------------------------------------------------------------------------- /configs/config/pretrain/npid/models/resnet101.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 101 8 | HEAD: 9 | PARAMS: [["mlp", {"dims": [2048, 128]}]] 10 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/resnext101.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 101 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [2048, 1000]}]] 10 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/resnext101.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 101 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [2048, 205]}]] 10 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/heads/d10444_d8192_d8192_d256_proto16k.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | HEAD: 5 | PARAMS: [ 6 | ["swav_head", {"dims": [10444, 8192, 8192, 256], "use_bn": False, "num_clusters": [16000]}], 7 | ] 8 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/heads/d7392_d8192_d8192_d256_proto16k.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | HEAD: 5 | PARAMS: [ 6 | ["swav_head", {"dims": [7392, 8192, 8192, 256], "use_bn": False, "num_clusters": [16000]}], 7 | ] 8 | -------------------------------------------------------------------------------- /website/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | node_modules 4 | 5 | lib/core/metadata.js 6 | lib/core/MetadataBlog.js 7 | 8 | website/translated_docs 9 | website/build/ 10 | website/yarn.lock 11 | website/node_modules 12 | website/i18n/* 13 | website/_tutorials/* 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_32gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [3712, 205]}]] 10 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/regnet64Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_64gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [2976, 205]}]] 10 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet256Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_256gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [5088, 1000]}]] 10 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_32gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [3712, 1000]}]] 10 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet64Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_64gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [2976, 1000]}]] 10 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/regnet256Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_256gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [5088, 205]}]] 10 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_32gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [3712, 1000]}]] 10 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_32gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [3712, 205]}]] 10 | -------------------------------------------------------------------------------- /configs/config/pretrain/npid/models/resnet50_w2.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 2 9 | HEAD: 10 | PARAMS: [["mlp", {"dims": [4096, 128]}]] 11 | -------------------------------------------------------------------------------- /configs/config/pretrain/npid/models/resnet50_w3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 3 9 | HEAD: 10 | PARAMS: [["mlp", {"dims": [6144, 128]}]] 11 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | Facebook has adopted a Code of Conduct that we expect project participants to adhere to. 4 | Please read the [full text](https://code.fb.com/codeofconduct/) 5 | so that you can understand what actions will and will not be tolerated. 6 | -------------------------------------------------------------------------------- /docs/source/flowcharts/train_workflow.rst: -------------------------------------------------------------------------------- 1 | Training: Step-by-step execution 2 | ============================================= 3 | 4 | We demonstrate step-by-step execution of how training works in VISSL in the following flowchart. 5 | 6 | .. image:: ../_static/img/train_flowchart.png 7 | -------------------------------------------------------------------------------- /vissl/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | 7 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 8 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/resnet50_w2.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 2 9 | HEAD: 10 | PARAMS: [['mlp', {'dims': [4096, 205]}]] 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/resnet50_w3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 3 9 | HEAD: 10 | PARAMS: [['mlp', {'dims': [6144, 205]}]] 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/imagenet1k/semi_sup_datasets/simclr_in1k_per01.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATA_SOURCES: [disk_filelist] 6 | LABEL_SOURCES: [disk_filelist] 7 | DATASET_NAMES: ["google-imagenet1k-per01"] 8 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/imagenet1k/semi_sup_datasets/simclr_in1k_per10.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATA_SOURCES: [disk_filelist] 6 | LABEL_SOURCES: [disk_filelist] 7 | DATASET_NAMES: ["google-imagenet1k-per10"] 8 | -------------------------------------------------------------------------------- /dev/packaging/apex_pip/after.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | sudo chown -R $USER inside/output 7 | python publish.py 8 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/resnet50_w2.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 2 9 | HEAD: 10 | PARAMS: [['mlp', {'dims': [4096, 1000]}]] 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/resnet50_w3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 3 9 | HEAD: 10 | PARAMS: [['mlp', {'dims': [6144, 1000]}]] 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/supervised/resnext50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | HEAD: 9 | PARAMS: [ 10 | ["mlp", {"dims": [2048, 1000]}], 11 | ] 12 | -------------------------------------------------------------------------------- /docs/source/flowcharts/svm_workflow.rst: -------------------------------------------------------------------------------- 1 | Benchmark on VOC07: Step-by-step execution 2 | ============================================= 3 | 4 | We demonstrate step-by-step execution of SVM training benchmark in VISSL in the following flowchart. 5 | 6 | .. image:: ../_static/img/train_svm_flowchart.png 7 | -------------------------------------------------------------------------------- /vissl/utils/svm_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | 7 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 8 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/resnet50_w2.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 2 9 | HEAD: 10 | PARAMS: [['mlp', {'dims': [4096, 1000]}]] 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/resnet50_w3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 3 9 | HEAD: 10 | PARAMS: [['mlp', {'dims': [6144, 1000]}]] 11 | -------------------------------------------------------------------------------- /docs/source/flowcharts/extract_workflow.rst: -------------------------------------------------------------------------------- 1 | Feature Extraction: Step-by-step execution 2 | ============================================= 3 | 4 | We demonstrate step-by-step how feature extraction happens in VISSL in the following flowchart. 5 | 6 | .. image:: ../_static/img/extract_features_flowchart.png 7 | -------------------------------------------------------------------------------- /vissl/utils/instance_retrieval_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | 7 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 8 | -------------------------------------------------------------------------------- /dev/packaging/apex_pip/go.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | sudo docker run --rm -v $PWD/inside:/inside pytorch/conda-cuda bash inside/a.sh 7 | -------------------------------------------------------------------------------- /dev/packaging/apex_conda/go.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | sudo docker run --rm -v $PWD/inside:/inside pytorch/conda-cuda python3 inside/build.py 7 | -------------------------------------------------------------------------------- /docs/source/flowcharts/nearest_neighbor.rst: -------------------------------------------------------------------------------- 1 | Nearest Neighbor Benchmark: Step-by-step execution 2 | =================================================== 3 | 4 | We demonstrate step-by-step execution of Nearest Neighbor benchmark in VISSL in the following flowchart. 5 | 6 | .. image:: ../_static/img/nearest_neighbor_flowchart.png 7 | -------------------------------------------------------------------------------- /dev/packaging/vissl_pip/after.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | set -ex 7 | 8 | sudo chown -R "$USER" output 9 | python publish.py 10 | bash to_pypi.sh 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F4DA VISSL Documentation" 3 | about: Report an issue related to VISSL documentation 4 | 5 | --- 6 | 7 | ## 📚 VISSL Documentation 8 | 9 | A clear and concise description of what content in the [Docs](https://github.com/facebookresearch/vissl/tree/master/docs) is an issue. 10 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [3024, 3024, 128], "use_bn": False, "num_clusters": []}], 11 | ] 12 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_32gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [3712, 3712, 128], "use_bn": False, "num_clusters": []}], 11 | ] 12 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_8gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [2016, 2016, 128], "use_bn": False, "num_clusters": []}], 11 | ] 12 | -------------------------------------------------------------------------------- /configs/config/pretrain/jigsaw/optimization/bs32_8gpu_yfcc_10ep.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | OPTIMIZER: 4 | name: sgd 5 | num_epochs: 10 6 | param_schedulers: 7 | lr: 8 | name: multistep 9 | values: [0.1, 0.01, 0.001, 0.0001] 10 | milestones: [3, 6, 9] 11 | update_interval: epoch 12 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_128gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [7392, 7392, 128], "use_bn": False, "num_clusters": []}], 11 | ] 12 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/regnet16Gf_d256.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [3024, 3024, 256], "use_bn": False, "num_clusters": []}], 11 | ] 12 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/regnet32Gf_d256.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_32gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [3712, 3712, 256], "use_bn": False, "num_clusters": []}], 11 | ] 12 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/regnet8Gf_d256.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_8gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [2016, 2016, 256], "use_bn": False, "num_clusters": []}], 11 | ] 12 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet32Gf_bn.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_32gf 8 | HEAD: 9 | PARAMS: [["eval_mlp", {"in_channels": 3712, "dims": [3712, 1000]}]] 10 | # PARAMS: [['mlp', {'dims': [3712, 1000]}]] 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/regnet128Gf_d256.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_128gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [7392, 7392, 256], "use_bn": False, "num_clusters": []}], 11 | ] 12 | -------------------------------------------------------------------------------- /dev/packaging/vissl_pip/test/README.md: -------------------------------------------------------------------------------- 1 | Run the tests against the PyPI backage. 2 | 3 | 4 | 1. Make sure you have cuda 10.1 working as 5 | that is assumed by the testing phase. E.g. on the FAIR cluster 6 | 7 | ``` 8 | module purge 9 | module load cuda/10.1 10 | module load NCCL/2.7.6-1-cuda.10.1 11 | ``` 12 | 13 | 2. Run `bash run.sh` in this directory. 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/resnet50_w2.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 2 9 | HEAD: 10 | PARAMS: [ 11 | ['swav_head', {'dims': [4096, 4096, 128], 'use_bn': True, 'num_clusters': []}] 12 | ] 13 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/resnet50_w3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 3 9 | HEAD: 10 | PARAMS: [ 11 | ['swav_head', {'dims': [6144, 6144, 128], 'use_bn': True, 'num_clusters': []}] 12 | ] 13 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/resnet50_w4.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 4 9 | HEAD: 10 | PARAMS: [ 11 | ['swav_head', {'dims': [8192, 8192, 128], 'use_bn': True, 'num_clusters': []}] 12 | ] 13 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/voc07/rn50_w2_transfer_voc07_detectron2_e2e.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "rn50_transfer_voc07_detectron2_e2e.yaml" 2 | MODEL: 3 | RESNETS: 4 | DEPTH: 50 5 | NORM: "SyncBN" 6 | STRIDE_IN_1X1: False 7 | ######## for rn50-w2 ########### 8 | WIDTH_PER_GROUP: 128 9 | RES2_OUT_CHANNELS: 512 10 | STEM_OUT_CHANNELS: 128 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/voc07/rn50_w3_transfer_voc07_detectron2_e2e.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "rn50_transfer_voc07_detectron2_e2e.yaml" 2 | MODEL: 3 | RESNETS: 4 | DEPTH: 50 5 | NORM: "SyncBN" 6 | STRIDE_IN_1X1: False 7 | ######## for rn50-w2 ########### 8 | WIDTH_PER_GROUP: 192 9 | RES2_OUT_CHANNELS: 768 10 | STEM_OUT_CHANNELS: 192 11 | -------------------------------------------------------------------------------- /configs/config/pretrain/datasets/yfcc100m.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | NUM_DATALOADER_WORKERS: 10 5 | TRAIN: 6 | DATA_SOURCES: [disk_filelist] 7 | DATASET_NAMES: [yfcc100m] 8 | MMAP_MODE: True 9 | COPY_TO_LOCAL_DISK: True 10 | COPY_DESTINATION_DIR: /tmp/yfcc100m/ 11 | DROP_LAST: True 12 | MACHINE: 13 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/resnext101.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 101 8 | ######## resnext101-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | HEAD: 12 | PARAMS: [['mlp', {'dims': [2048, 205]}]] 13 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/resnext101.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 101 8 | ######## resnext101-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | HEAD: 12 | PARAMS: [['mlp', {'dims': [2048, 1000]}]] 13 | -------------------------------------------------------------------------------- /dev/packaging/vissl_pip/to_pypi.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | set -e 8 | 9 | TOKEN=redacted 10 | 11 | twine upload --verbose --username __token__ --password $TOKEN output/py3.6/*.whl 12 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/voc0712/iccv19/rn50_w2_transfer_voc0712_detectron2_e2e.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "rn50_transfer_voc0712_detectron2_e2e.yaml" 2 | MODEL: 3 | RESNETS: 4 | DEPTH: 50 5 | NORM: "SyncBN" 6 | STRIDE_IN_1X1: False 7 | ######## for rn50-w2 ########### 8 | WIDTH_PER_GROUP: 128 9 | RES2_OUT_CHANNELS: 512 10 | STEM_OUT_CHANNELS: 128 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/voc0712/iccv19/rn50_w3_transfer_voc0712_detectron2_e2e.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "rn50_transfer_voc0712_detectron2_e2e.yaml" 2 | MODEL: 3 | RESNETS: 4 | DEPTH: 50 5 | NORM: "SyncBN" 6 | STRIDE_IN_1X1: False 7 | ######## for rn50-w3 ########### 8 | WIDTH_PER_GROUP: 192 9 | RES2_OUT_CHANNELS: 768 10 | STEM_OUT_CHANNELS: 192 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/voc0712/mocoV2/rn50_w2_transfer_voc0712_detectron2_e2e.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "rn50_transfer_voc0712_detectron2_e2e.yaml" 2 | MODEL: 3 | RESNETS: 4 | DEPTH: 50 5 | NORM: "SyncBN" 6 | STRIDE_IN_1X1: False 7 | ######## for rn50-w2 ########### 8 | WIDTH_PER_GROUP: 128 9 | RES2_OUT_CHANNELS: 512 10 | STEM_OUT_CHANNELS: 128 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/voc0712/mocoV2/rn50_w3_transfer_voc0712_detectron2_e2e.yaml: -------------------------------------------------------------------------------- 1 | _BASE_: "rn50_transfer_voc0712_detectron2_e2e.yaml" 2 | MODEL: 3 | RESNETS: 4 | DEPTH: 50 5 | NORM: "SyncBN" 6 | STRIDE_IN_1X1: False 7 | ######## for rn50-w3 ########### 8 | WIDTH_PER_GROUP: 192 9 | RES2_OUT_CHANNELS: 768 10 | STEM_OUT_CHANNELS: 192 11 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/models/resnet50_w2.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 2 9 | HEAD: 10 | PARAMS: [ 11 | ["mlp", {"dims": [4096, 4096], "use_relu": True, "skip_last_layer_relu_bn": False}], 12 | ["mlp", {"dims": [4096, 128]}], 13 | ] 14 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/models/resnet50_w3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 3 9 | HEAD: 10 | PARAMS: [ 11 | ["mlp", {"dims": [6144, 6144], "use_relu": True, "skip_last_layer_relu_bn": False}], 12 | ["mlp", {"dims": [6144, 128]}], 13 | ] 14 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/models/resnet50_w4.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 4 9 | HEAD: 10 | PARAMS: [ 11 | ["mlp", {"dims": [8192, 8192], "use_relu": True, "skip_last_layer_relu_bn": False}], 12 | ["mlp", {"dims": [8192, 128]}], 13 | ] 14 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # Keep this sorted for easy search. 2 | # Keep versions pinned for testing reproducibility. 3 | cython==0.29.22 4 | fairscale@https://github.com/facebookresearch/fairscale/tarball/df7db85cef7f9c30a5b821007754b96eb1f977b6 5 | fvcore==0.1.3.post20210317 6 | hydra-core==1.0.7 7 | numpy==1.19.5 8 | parameterized==0.7.4 9 | scikit-learn==0.24.1 10 | submitit==1.3.3 11 | tabulate==0.8.9 12 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/dataset/pirl_in1k_per01.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["imagenet1k-per01"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/dataset/pirl_in1k_per10.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["imagenet1k-per10"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/simclr/resnet50_w2.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 2 9 | HEAD: 10 | PARAMS: [ 11 | ["mlp", {"dims": [4096, 4096], "use_relu": True, "skip_last_layer_relu_bn": False}], 12 | ["mlp", {"dims": [4096, 128]}], 13 | ] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/simclr/resnet50_w3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 3 9 | HEAD: 10 | PARAMS: [ 11 | ["mlp", {"dims": [6144, 6144], "use_relu": True, "skip_last_layer_relu_bn": False}], 12 | ["mlp", {"dims": [6144, 128]}], 13 | ] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/simclr/resnet50_w4.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 4 9 | HEAD: 10 | PARAMS: [ 11 | ["mlp", {"dims": [8192, 8192], "use_relu": True, "skip_last_layer_relu_bn": False}], 12 | ["mlp", {"dims": [8192, 128]}], 13 | ] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/dataset/random_in1k_per05.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["imagenet1k-per05-random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/dataset/random_in1k_per20.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["imagenet1k-per20-random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/dataset/random_in1k_per50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["imagenet1k-per50-random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/feature_extraction/with_head/rn50_supervised.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | EVAL_MODE_ON: True 6 | FREEZE_TRUNK_AND_HEAD: True 7 | EVAL_TRUNK_AND_HEAD: True 8 | TRUNK: 9 | NAME: resnet 10 | RESNETS: 11 | DEPTH: 50 12 | HEAD: 13 | PARAMS: [ 14 | ["mlp", {"dims": [2048, 1000]}], 15 | ] 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/dataset/random_places205_per01.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per01_random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/dataset/random_places205_per05.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per05_random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/dataset/random_places205_per10.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per10_random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/dataset/random_places205_per20.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per20_random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/dataset/random_places205_per50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per50_random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/models/regnet256Gf_1.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | depth: 27 8 | w_0: 640 9 | w_a: 230.83 10 | w_m: 2.53 11 | group_width: 373 12 | HEAD: 13 | PARAMS: [ 14 | ["swav_head", {"dims": [10444, 10444, 128], "use_bn": False, "num_clusters": [3000]}], 15 | ] 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/dataset/balanced_places205_per01.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per01_balanced"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/dataset/balanced_places205_per05.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per05_balanced"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/dataset/balanced_places205_per10.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per10_balanced"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/dataset/balanced_places205_per20.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per20_balanced"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/datasets/imagenet_1k.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATA_SOURCES: [disk_folder] 6 | LABEL_SOURCES: [disk_folder] 7 | DATASET_NAMES: [imagenet1k_folder] 8 | TEST: 9 | DATA_SOURCES: [disk_folder] 10 | LABEL_SOURCES: [disk_folder] 11 | DATASET_NAMES: [imagenet1k_folder] 12 | OPTIMIZER: 13 | num_epochs: 30 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/regnet64Gf_3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | depth: 20 8 | w_0: 352 9 | w_a: 147.48 10 | w_m: 2.4 11 | group_width: 328 12 | HEAD: 13 | PARAMS: [ 14 | ["swav_head", {"dims": [4920, 4920, 128], "use_bn": False, "num_clusters": []}], 15 | ] 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/regnet64Gf_3_d256.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | depth: 20 8 | w_0: 352 9 | w_a: 147.48 10 | w_m: 2.4 11 | group_width: 328 12 | HEAD: 13 | PARAMS: [ 14 | ["swav_head", {"dims": [4920, 4920, 256], "use_bn": False, "num_clusters": []}], 15 | ] 16 | -------------------------------------------------------------------------------- /vissl/utils/README.md: -------------------------------------------------------------------------------- 1 | # Utility functions 2 | 3 | This folder contain helpful utility functions that are useful for building models or training code using the config system. 4 | 5 | ## Using `collect_env.py` to debug install/build 6 | 7 | Environment info can be collected using the following command: 8 | ``` 9 | wget -nc -q https://github.com/facebookresearch/vissl/raw/master/vissl/utils/collect_env.py && python collect_env.py 10 | ``` 11 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/openimages/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["avgpool", ["Identity", []]], 7 | ] 8 | TRUNK: 9 | NAME: regnet 10 | REGNET: 11 | name: regnet_y_128gf 12 | HEAD: 13 | PARAMS: [ 14 | ["mlp", {"dims": [7392, 9605]}], 15 | ] 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/low_shot_transfer/places205/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 7 | ["res5", ["AdaptiveAvgPool2d", [[6, 1]]]], 8 | ["avgpool", ["Identity", []]], 9 | ] 10 | TRUNK: 11 | NAME: regnet 12 | REGNET: 13 | name: regnet_y_8gf 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/datasets/imagenet_1k_10percent.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATA_SOURCES: [disk_folder] 6 | LABEL_SOURCES: [disk_folder] 7 | DATASET_NAMES: [google-imagenet1k-per10] 8 | TEST: 9 | DATA_SOURCES: [disk_folder] 10 | LABEL_SOURCES: [disk_folder] 11 | DATASET_NAMES: [google-imagenet1k-per10] 12 | OPTIMIZER: 13 | num_epochs: 30 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/datasets/imagenet_1k_1percent.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATA_SOURCES: [disk_folder] 6 | LABEL_SOURCES: [disk_folder] 7 | DATASET_NAMES: [google-imagenet1k-per01] 8 | TEST: 9 | DATA_SOURCES: [disk_folder] 10 | LABEL_SOURCES: [disk_folder] 11 | DATASET_NAMES: [google-imagenet1k-per01] 12 | OPTIMIZER: 13 | num_epochs: 60 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_8gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [2016, 1000]}]] 10 | DATA: 11 | # to reduce the training time, we use 64img/gpu (16GB machine) 12 | TRAIN: 13 | BATCHSIZE_PER_REPLICA: 64 14 | TEST: 15 | BATCHSIZE_PER_REPLICA: 64 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [3024, 205]}]] 10 | DATA: 11 | # to reduce the training time, we use 64img/gpu (16GB machine) 12 | TRAIN: 13 | BATCHSIZE_PER_REPLICA: 64 14 | TEST: 15 | BATCHSIZE_PER_REPLICA: 64 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_8gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [2016, 205]}]] 10 | DATA: 11 | # to reduce the training time, we use 64img/gpu (16GB machine) 12 | TRAIN: 13 | BATCHSIZE_PER_REPLICA: 64 14 | TEST: 15 | BATCHSIZE_PER_REPLICA: 64 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/low_shot_transfer/places205/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 7 | ["res5", ["AdaptiveAvgPool2d", [[4, 1]]]], 8 | ["avgpool", ["Identity", []]], 9 | ] 10 | TRUNK: 11 | NAME: regnet 12 | REGNET: 13 | name: regnet_y_16gf 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/low_shot_transfer/places205/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["res4", ["AdaptiveAvgPool2d", [[7, 1]]]], 7 | ["res5", ["AdaptiveAvgPool2d", [[3, 1]]]], 8 | ["avgpool", ["Identity", []]], 9 | ] 10 | TRUNK: 11 | NAME: regnet 12 | REGNET: 13 | name: regnet_y_32gf 14 | -------------------------------------------------------------------------------- /vissl/data/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from vissl.data.datasets.coco import get_coco_imgs_labels_info 7 | from vissl.data.datasets.pascal_voc import get_voc_images_labels_info 8 | 9 | 10 | __all__ = ["get_coco_imgs_labels_info", "get_voc_images_labels_info"] 11 | -------------------------------------------------------------------------------- /website/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "examples": "docusaurus-examples", 4 | "start": "docusaurus-start", 5 | "build": "docusaurus-build", 6 | "publish-gh-pages": "docusaurus-publish", 7 | "write-translations": "docusaurus-write-translations", 8 | "version": "docusaurus-version", 9 | "rename-version": "docusaurus-rename-version" 10 | }, 11 | "devDependencies": { 12 | "docusaurus": "^1.14.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [3024, 1000]}]] 10 | DATA: 11 | # to reduce the training time, we use 64img/gpu (16GB machine) 12 | TRAIN: 13 | BATCHSIZE_PER_REPLICA: 64 14 | TEST: 15 | BATCHSIZE_PER_REPLICA: 64 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_8gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [2016, 205]}]] 10 | DATA: 11 | # to reduce the training time, we use 64img/gpu (16GB machine) 12 | TRAIN: 13 | BATCHSIZE_PER_REPLICA: 64 14 | TEST: 15 | BATCHSIZE_PER_REPLICA: 64 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/semi_sup_datasets/balanced_places205_per01.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per01_balanced"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001, 0.0001, 0.00001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/semi_sup_datasets/balanced_places205_per05.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per05_balanced"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001, 0.0001, 0.00001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/semi_sup_datasets/balanced_places205_per10.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per10_balanced"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001, 0.0001, 0.00001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/semi_sup_datasets/balanced_places205_per20.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per20_balanced"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001, 0.0001, 0.00001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/semi_sup_datasets/random_places205_per01.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per01_random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001, 0.0001, 0.00001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/semi_sup_datasets/random_places205_per05.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per05_random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001, 0.0001, 0.00001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/semi_sup_datasets/random_places205_per10.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per10_random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001, 0.0001, 0.00001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/semi_sup_datasets/random_places205_per20.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per20_random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001, 0.0001, 0.00001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/semi_sup_datasets/random_places205_per50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATASET_NAMES: ["places205_per50_random"] 6 | OPTIMIZER: 7 | param_schedulers: 8 | lr: 9 | auto_lr_scaling: 10 | auto_scale: true 11 | base_value: 0.01 12 | base_lr_batch_size: 256 13 | values: [0.01, 0.001, 0.0001, 0.00001] 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [3024, 1000]}]] 10 | DATA: 11 | # to reduce the training time, we use 64img/gpu (16GB machine) 12 | TRAIN: 13 | BATCHSIZE_PER_REPLICA: 64 14 | TEST: 15 | BATCHSIZE_PER_REPLICA: 64 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_8gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [2016, 1000]}]] 10 | DATA: 11 | # to reduce the training time, we use 64img/gpu (16GB machine) 12 | TRAIN: 13 | BATCHSIZE_PER_REPLICA: 64 14 | TEST: 15 | BATCHSIZE_PER_REPLICA: 64 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [['mlp', {'dims': [3024, 205]}]] 10 | DATA: 11 | # to reduce the training time, we use 64img/gpu (16GB machine) 12 | TRAIN: 13 | BATCHSIZE_PER_REPLICA: 64 14 | TEST: 15 | BATCHSIZE_PER_REPLICA: 64 16 | -------------------------------------------------------------------------------- /configs/config/feature_extraction/trunk_only/rn50_res5.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | EVAL_MODE_ON: True 6 | FREEZE_TRUNK_ONLY: True 7 | EXTRACT_TRUNK_FEATURES_ONLY: True 8 | SHOULD_FLATTEN_FEATS: False 9 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 10 | ["res5avg", ["Identity", []]], 11 | ] 12 | TRUNK: 13 | NAME: resnet 14 | RESNETS: 15 | DEPTH: 50 16 | -------------------------------------------------------------------------------- /configs/config/feature_extraction/with_head/rn50_swav.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | EVAL_MODE_ON: True 6 | FREEZE_TRUNK_AND_HEAD: True 7 | EVAL_TRUNK_AND_HEAD: True 8 | TRUNK: 9 | NAME: resnet 10 | RESNETS: 11 | DEPTH: 50 12 | HEAD: 13 | PARAMS: [ 14 | ["swav_head", {"dims": [2048, 2048, 128], "use_bn": True, "num_clusters": [3000]}], 15 | ] 16 | -------------------------------------------------------------------------------- /vissl/models/trunks/resnet.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | 7 | # --------------------------------------------------------------------------- # 8 | # ResNets are implemented as special case of ResNeXt. Please see resnext.py 9 | # --------------------------------------------------------------------------- # 10 | -------------------------------------------------------------------------------- /vissl/losses/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from pathlib import Path 7 | 8 | from classy_vision.generic.registry_utils import import_all_modules 9 | 10 | 11 | FILE_ROOT = Path(__file__).parent 12 | 13 | # automatically import any Python files in the losses/ directory 14 | import_all_modules(FILE_ROOT, "vissl.losses") 15 | -------------------------------------------------------------------------------- /vissl/meters/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from pathlib import Path 7 | 8 | from classy_vision.generic.registry_utils import import_all_modules 9 | 10 | 11 | FILE_ROOT = Path(__file__).parent 12 | 13 | # automatically import any Python files in the meters/ directory 14 | import_all_modules(FILE_ROOT, "vissl.meters") 15 | -------------------------------------------------------------------------------- /vissl/optimizers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | 7 | from vissl.optimizers.larc_fsdp import SGD_FSDP # noqa 8 | from vissl.optimizers.lars import LARS # noqa 9 | from vissl.optimizers.optimizer_helper import get_optimizer_param_groups # noqa 10 | 11 | 12 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 13 | -------------------------------------------------------------------------------- /configs/config/feature_extraction/with_head/rn50_simclr.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | EVAL_MODE_ON: True 6 | FREEZE_TRUNK_AND_HEAD: True 7 | EVAL_TRUNK_AND_HEAD: True 8 | TRUNK: 9 | NAME: resnet 10 | RESNETS: 11 | DEPTH: 50 12 | HEAD: 13 | PARAMS: [ 14 | ["mlp", {"dims": [2048, 2048], "use_relu": True, "skip_last_layer_relu_bn": False}], 15 | ["mlp", {"dims": [2048, 128]}], 16 | ] 17 | -------------------------------------------------------------------------------- /configs/config/benchmark/low_shot_transfer/places205/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["res4", ["AdaptiveAvgPool2d", [[3, 1]]]], 7 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 8 | ["avgpool", ["Identity", []]], 9 | ] 10 | TRUNK: 11 | NAME: regnet 12 | REGNET: 13 | name: regnet_y_128gf 14 | HEAD: 15 | PARAMS: [["mlp", {"dims": [2048, 20]}]] 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 7 | ["res5", ["AdaptiveAvgPool2d", [[4, 1]]]], 8 | ["avgpool", ["Identity", []]], 9 | ] 10 | TRUNK: 11 | NAME: regnet 12 | REGNET: 13 | name: regnet_y_16gf 14 | HEAD: 15 | PARAMS: [["mlp", {"dims": [2048, 20]}]] 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["res4", ["AdaptiveAvgPool2d", [[7, 1]]]], 7 | ["res5", ["AdaptiveAvgPool2d", [[3, 1]]]], 8 | ["avgpool", ["Identity", []]], 9 | ] 10 | TRUNK: 11 | NAME: regnet 12 | REGNET: 13 | name: regnet_y_32gf 14 | HEAD: 15 | PARAMS: [["mlp", {"dims": [2048, 20]}]] 16 | -------------------------------------------------------------------------------- /dev/packaging/vissl_pip/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | set -ex 8 | 9 | #root=$PWD/../../../.. 10 | f(){ 11 | echo -v $PWD/../../../../$1:/loc1/$1 12 | } 13 | 14 | sudo docker run --runtime=nvidia --shm-size 4000000000 -it --rm $(f dev) $(f configs) $(f tools) $(f tests) -v $PWD:/loc pytorch/conda-cuda bash /loc/test.sh 15 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["res4", ["AdaptiveAvgPool2d", [[3, 1]]]], 7 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 8 | ["avgpool", ["Identity", []]], 9 | ] 10 | TRUNK: 11 | NAME: regnet 12 | REGNET: 13 | name: regnet_y_128gf 14 | HEAD: 15 | PARAMS: [["mlp", {"dims": [2048, 20]}]] 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/imagenet1k/semi_sup_datasets/pirl_in1k_per01.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATA_SOURCES: [disk_filelist] 6 | LABEL_SOURCES: [disk_filelist] 7 | DATASET_NAMES: ["imagenet1k-per01"] 8 | OPTIMIZER: 9 | param_schedulers: 10 | lr: 11 | auto_lr_scaling: 12 | auto_scale: true 13 | base_value: 0.01 14 | base_lr_batch_size: 256 15 | values: [0.01, 0.001, 0.0001, 0.00001] 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/imagenet1k/semi_sup_datasets/pirl_in1k_per10.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | DATA_SOURCES: [disk_filelist] 6 | LABEL_SOURCES: [disk_filelist] 7 | DATASET_NAMES: ["imagenet1k-per10"] 8 | OPTIMIZER: 9 | param_schedulers: 10 | lr: 11 | auto_lr_scaling: 12 | auto_scale: true 13 | base_value: 0.01 14 | base_lr_batch_size: 256 15 | values: [0.01, 0.001, 0.0001, 0.00001] 16 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/models/regnet400mf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | # Other regnet model names can be found inside 8 | # regnet.py in classy_vision's subdir. Please 9 | # remember to change HEAD.PARAMS below accordingly 10 | # as well. 11 | name: regnet_y_400mf 12 | HEAD: 13 | PARAMS: [ 14 | ["swav_head", {"dims": [440, 440, 128], "use_bn": True, "num_clusters": [3000]}], 15 | ] 16 | -------------------------------------------------------------------------------- /docs/source/api/engine.rst: -------------------------------------------------------------------------------- 1 | vissl.engines package 2 | =========================== 3 | 4 | vissl.engines.train module 5 | ------------------------------------------------------------ 6 | .. automodule:: vissl.engines.train 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | 11 | 12 | vissl.engines.extract_features module 13 | ------------------------------------------------------------ 14 | .. automodule:: vissl.engines.extract_features 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet16Gf_bn.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [["eval_mlp", {"in_channels": 3024, "dims": [3024, 1000]}]] 10 | # PARAMS: [['mlp', {'dims': [3024, 1000]}]] 11 | DATA: 12 | # to reduce the training time, we use 64img/gpu (16GB machine) 13 | TRAIN: 14 | BATCHSIZE_PER_REPLICA: 64 15 | TEST: 16 | BATCHSIZE_PER_REPLICA: 64 17 | -------------------------------------------------------------------------------- /configs/config/benchmark/low_shot_transfer/places205/models/regnet64Gf_3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["res4", ["AdaptiveAvgPool2d", [[5, 1]]]], 7 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 8 | ["avgpool", ["Identity", []]], 9 | ] 10 | TRUNK: 11 | NAME: regnet 12 | REGNET: 13 | depth: 20 14 | w_0: 352 15 | w_a: 147.48 16 | w_m: 2.4 17 | group_width: 328 18 | -------------------------------------------------------------------------------- /website/static/img/pytorch.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vissl/optimizers/param_scheduler/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from pathlib import Path 7 | 8 | from classy_vision.generic.registry_utils import import_all_modules 9 | 10 | 11 | FILE_ROOT = Path(__file__).parent 12 | 13 | # automatically import any Python files in the param_scheduler/ directory 14 | import_all_modules(FILE_ROOT, "vissl.optimizers.param_scheduler") 15 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/resnext101_32x4d.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | ######## resnext101-32x4d ####### 7 | RESNETS: 8 | DEPTH: 101 9 | GROUPS: 32 10 | WIDTH_PER_GROUP: 4 11 | HEAD: 12 | PARAMS: [['mlp', {'dims': [2048, 205]}]] 13 | DATA: 14 | # to reduce the training time, we use 64img/gpu (16GB machine) 15 | TRAIN: 16 | BATCHSIZE_PER_REPLICA: 64 17 | TEST: 18 | BATCHSIZE_PER_REPLICA: 64 19 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/models/regnet400mf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | # Other model names can be found inside regnet.py within 8 | # the classy_vision project sub-directory. Please remember 9 | # to change HEAD.PARAMS dimension accordingly if you change 10 | # to a different model. 11 | name: regnet_y_400mf 12 | HEAD: 13 | PARAMS: [ 14 | ["mlp", {"dims": [440, 440, 128], "use_relu": True}], 15 | ] 16 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/resnext101_32x4d.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | ######## resnext101-32x4d ####### 7 | RESNETS: 8 | DEPTH: 101 9 | GROUPS: 32 10 | WIDTH_PER_GROUP: 4 11 | HEAD: 12 | PARAMS: [['mlp', {'dims': [2048, 1000]}]] 13 | DATA: 14 | # to reduce the training time, we use 64img/gpu (16GB machine) 15 | TRAIN: 16 | BATCHSIZE_PER_REPLICA: 64 17 | TEST: 18 | BATCHSIZE_PER_REPLICA: 64 19 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/resnext50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | ######## resnext50-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext50-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext50-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | HEAD: 18 | PARAMS: [['mlp', {'dims': [2048, 205]}]] 19 | -------------------------------------------------------------------------------- /configs/config/debugging/benchmark/fine_tuning/models/regnet16Gf_mlp.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet # This could be overriden by command line to be regnet_fsdp 6 | REGNET: 7 | # The following is the same as the model "regnet_y_16gf: from ClassyVision/classy_vision/models/regnet.py 8 | depth: 18 9 | w_0: 200 10 | w_a: 106.23 11 | w_m: 2.48 12 | group_width: 112 13 | HEAD: 14 | PARAMS: [ 15 | ["mlp", {"dims": [3024, 1000]}], 16 | ] 17 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/resnext50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | ######## resnext50-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext50-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext50-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | HEAD: 18 | PARAMS: [['mlp', {'dims': [2048, 1000]}]] 19 | -------------------------------------------------------------------------------- /dev/packaging/vissl_pip/go.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | rm -rf ClassyVision 7 | git clone https://github.com/facebookresearch/ClassyVision.git 8 | rm -rf ../../../classy_vision 9 | cp -r ClassyVision/classy_vision ../../../classy_vision 10 | rm -rf ../../../fairscale 11 | 12 | sudo docker run --rm -v $PWD/../../..:/inside pytorch/conda-cuda bash inside/dev/packaging/vissl_pip/inside.sh 13 | -------------------------------------------------------------------------------- /vissl/utils/visualize.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | 7 | def matplotlib_figure_to_image(fig): 8 | """ 9 | Convert a matplotlib figure to an image in RGB format, for instance 10 | to save it on disk 11 | """ 12 | import io 13 | 14 | from PIL import Image 15 | 16 | buf = io.BytesIO() 17 | fig.savefig(buf) 18 | buf.seek(0) 19 | return Image.open(buf).convert("RGB") 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/resnext50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | ######## resnext50-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext50-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext50-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | HEAD: 18 | PARAMS: [['mlp', {'dims': [2048, 1000]}]] 19 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/resnext50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | ######## resnext50-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext50-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext50-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | HEAD: 18 | PARAMS: [['mlp', {'dims': [2048, 205]}]] 19 | -------------------------------------------------------------------------------- /configs/config/debugging/benchmark/linear_image_classification/models/regnet16Gf_mlp.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet # This could be overriden by command line to be regnet_fsdp 6 | REGNET: 7 | # The following is the same as the model "regnet_y_16gf: from ClassyVision/classy_vision/models/regnet.py 8 | depth: 18 9 | w_0: 200 10 | w_a: 106.23 11 | w_m: 2.48 12 | group_width: 112 13 | HEAD: 14 | PARAMS: [ 15 | ["mlp", {"dims": [3024, 10]}], 16 | ] 17 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/optimization/bs64_4gpu.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 64 6 | DISTRIBUTED: 7 | NUM_NODES: 1 8 | NUM_PROC_PER_NODE: 4 9 | OPTIMIZER: 10 | param_schedulers: 11 | lr: 12 | auto_lr_scaling: 13 | auto_scale: true 14 | base_value: 0.6 15 | base_lr_batch_size: 256 16 | LOSS: 17 | swav_loss: 18 | queue: 19 | queue_length: 3840 20 | start_iter: 75075 # 15 epochs where 1epoch = 5005 iterations 21 | -------------------------------------------------------------------------------- /vissl/engines/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | 7 | from vissl.engines.engine_registry import register_engine, run_engine # noqa 8 | from vissl.engines.extract_cluster import extract_clusters # noqa 9 | from vissl.engines.extract_features import extract_main # noqa 10 | from vissl.engines.train import train_main # noqa 11 | 12 | 13 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new-ssl-approach.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F31F New SSL approach addition" 3 | about: Submit a proposal/request to implement a new SSL approach in VISSL 4 | 5 | --- 6 | 7 | # 🌟 New SSL approach addition 8 | 9 | ## Approach description 10 | 11 | Important information only describing the approach, link to the arXiv paper. 12 | 13 | ## Open source status 14 | 15 | * [ ] the model implementation is available: (give details) 16 | * [ ] the model weights are available: (give details) 17 | * [ ] who are the authors: (mention them, if possible by @gh-username) 18 | -------------------------------------------------------------------------------- /configs/config/feature_extraction/trunk_only/regnet16Gf_layers.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | EVAL_MODE_ON: True 6 | FREEZE_TRUNK_ONLY: True 7 | EXTRACT_TRUNK_FEATURES_ONLY: True 8 | SHOULD_FLATTEN_FEATS: False 9 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 10 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 11 | ["res5", ["AdaptiveAvgPool2d", [[4, 1]]]], 12 | ["avgpool", ["Identity", []]], 13 | ] 14 | TRUNK: 15 | NAME: regnet 16 | REGNET: 17 | name: regnet_y_16gf 18 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/models/alexnet_rotnet.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["conv1", ["AdaptiveMaxPool2d", [12]]], 7 | ["conv2", ["AdaptiveMaxPool2d", [7]]], 8 | ["conv3", ["AdaptiveMaxPool2d", [5]]], 9 | ["conv4", ["AdaptiveMaxPool2d", [6]]], 10 | ["conv5", ["AdaptiveMaxPool2d", [6]]], 11 | ] 12 | TRUNK: 13 | NAME: alexnet_rotnet 14 | HEAD: 15 | PARAMS: [["mlp", {"dims": [9216, 20]}]] 16 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet # This could be overriden by command line to be regnet_fsdp 6 | REGNET: 7 | # The following is the same as the model "regnet_y_128gf: from ClassyVision/classy_vision/models/regnet.py 8 | depth: 27 9 | w_0: 456 10 | w_a: 160.83 11 | w_m: 2.52 12 | group_width: 264 13 | HEAD: 14 | PARAMS: [ 15 | ["swav_head", {"dims": [7392, 7392, 128], "use_bn": False, "num_clusters": [3000]}], 16 | ] 17 | -------------------------------------------------------------------------------- /configs/config/test/integration_test/models/finetune_regnet_fsdp.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: anynet 8 | depths: [2, 4, 11, 1] 9 | widths: [224, 448, 1232, 3024] 10 | group_widths: [112, 112, 112, 112] 11 | bottleneck_multipliers: [1.0, 1.0, 1.0, 1.0] 12 | strides: [2, 2, 2, 2] 13 | HEAD: 14 | PARAMS: [ 15 | ["mlp", {"dims": [3024, 1000]}], 16 | ] 17 | SYNC_BN_CONFIG: 18 | CONVERT_BN_TO_SYNC_BN: True 19 | SYNC_BN_TYPE: pytorch 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/models/regnet64Gf_3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["res4", ["AdaptiveAvgPool2d", [[5, 1]]]], 7 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 8 | ["avgpool", ["Identity", []]], 9 | ] 10 | TRUNK: 11 | NAME: regnet 12 | REGNET: 13 | depth: 20 14 | w_0: 352 15 | w_a: 147.48 16 | w_m: 2.4 17 | group_width: 328 18 | HEAD: 19 | PARAMS: [["mlp", {"dims": [2048, 20]}]] 20 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | [isort] 7 | combine_as_imports = True 8 | force_grid_wrap = False 9 | default_section = THIRDPARTY 10 | include_trailing_comma = True 11 | line_length = 88 12 | multi_line_output = 3 13 | use_parentheses = True 14 | lines_after_imports = 2 15 | ensure_newline_before_comments = True 16 | no_lines_before = FIRSTPARTY 17 | skip_glob = build/*,third-party/*,.github/* 18 | known_third_party = extra_scripts 19 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/resnext101_32x8d.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | ######## resnext101-32x8d ####### 7 | RESNETS: 8 | DEPTH: 101 9 | GROUPS: 32 10 | WIDTH_PER_GROUP: 8 11 | HEAD: 12 | PARAMS: [['mlp', {'dims': [2048, 1000]}]] 13 | SYNC_BN_CONFIG: 14 | CONVERT_BN_TO_SYNC_BN: True 15 | SYNC_BN_TYPE: apex 16 | GROUP_SIZE: 8 17 | DISTRIBUTED: 18 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 19 | INIT_METHOD: tcp 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/resnext101_32x8d.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | ######## resnext101-32x8d ####### 7 | RESNETS: 8 | DEPTH: 101 9 | GROUPS: 32 10 | WIDTH_PER_GROUP: 8 11 | HEAD: 12 | PARAMS: [['mlp', {'dims': [2048, 205]}]] 13 | SYNC_BN_CONFIG: 14 | CONVERT_BN_TO_SYNC_BN: True 15 | SYNC_BN_TYPE: apex 16 | GROUP_SIZE: 8 17 | DISTRIBUTED: 18 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 19 | INIT_METHOD: tcp 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/imagenet1k/optimizers/moco.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | OPTIMIZER: 4 | name: sgd 5 | weight_decay: 0.00 6 | momentum: 0.9 7 | num_epochs: 100 8 | nesterov: True 9 | regularize_bn: True 10 | regularize_bias: True 11 | param_schedulers: 12 | lr: 13 | auto_lr_scaling: 14 | auto_scale: true 15 | base_value: 30.0 16 | base_lr_batch_size: 256 17 | name: multistep 18 | values: [30.0, 3.0, 0.3] 19 | milestones: [60, 80] 20 | update_interval: epoch 21 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/models/regnet256Gf_1.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["res4", ["AdaptiveAvgPool2d", [[2, 1]]]], 7 | ["res5", ["AdaptiveAvgPool2d", [[1, 2]]]], 8 | ["avgpool", ["Identity", []]], 9 | ] 10 | TRUNK: 11 | NAME: regnet 12 | REGNET: 13 | depth: 27 14 | w_0: 640 15 | w_a: 230.83 16 | w_m: 2.53 17 | group_width: 373 18 | HEAD: 19 | PARAMS: [["mlp", {"dims": [2048, 20]}]] 20 | -------------------------------------------------------------------------------- /configs/config/debugging/benchmark/linear_image_classification/models/regnet16Gf_eval_mlp.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet # This could be overriden by command line to be regnet_fsdp 6 | REGNET: 7 | # The following is the same as the model "regnet_y_16gf: from ClassyVision/classy_vision/models/regnet.py 8 | depth: 18 9 | w_0: 200 10 | w_a: 106.23 11 | w_m: 2.48 12 | group_width: 112 13 | HEAD: 14 | PARAMS: [ 15 | ["eval_mlp", {"in_channels": 3024, "dims": [3024, 10]}], 16 | ] 17 | -------------------------------------------------------------------------------- /dev/packaging/apex_conda/upload.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | set -e 8 | 9 | TOKEN=redacted 10 | 11 | retry () { 12 | # run a command, and try again if it fails 13 | $* || (echo && sleep 8 && echo retrying && $*) 14 | } 15 | 16 | for file in inside/packaging/*.bz2 17 | do 18 | echo 19 | echo "${file}" 20 | retry anaconda --verbose -t "${TOKEN}" upload -u vissl --force "${file}" --no-progress 21 | done 22 | -------------------------------------------------------------------------------- /dev/packaging/vissl_conda/upload.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | set -e 8 | 9 | TOKEN=redacted 10 | 11 | retry () { 12 | # run a command, and try again if it fails 13 | $* || (echo && sleep 8 && echo retrying && $*) 14 | } 15 | 16 | for file in out/linux-64/*.tar.bz2 17 | do 18 | echo 19 | echo "${file}" 20 | retry anaconda --verbose -t "${TOKEN}" upload -u vissl --force "${file}" --no-progress 21 | done 22 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/transforms/swav_train_only.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | TRANSFORMS: 6 | - name: RandomResizedCrop 7 | size: 224 8 | - name: RandomHorizontalFlip 9 | p: 0.5 10 | - name: ImgPilColorDistortion 11 | strength: 1.0 12 | - name: ImgPilGaussianBlur 13 | p: 0.5 14 | radius_min: 0.1 15 | radius_max: 2.0 16 | - name: ToTensor 17 | - name: Normalize 18 | mean: [0.485, 0.456, 0.406] 19 | std: [0.229, 0.224, 0.225] 20 | -------------------------------------------------------------------------------- /configs/config/test/integration_test/models/eval_regnet_fsdp.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: anynet 8 | depths: [2, 4, 11, 1] 9 | widths: [224, 448, 1232, 3024] 10 | group_widths: [112, 112, 112, 112] 11 | bottleneck_multipliers: [1.0, 1.0, 1.0, 1.0] 12 | strides: [2, 2, 2, 2] 13 | HEAD: 14 | PARAMS: [ 15 | ["eval_mlp", {"in_channels": 3024, "dims": [12096, 1000]}], 16 | ] 17 | SYNC_BN_CONFIG: 18 | CONVERT_BN_TO_SYNC_BN: True 19 | SYNC_BN_TYPE: pytorch 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new-benchmark.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F31F New Benchmark addition" 3 | about: Submit a proposal/request to implement a new SSL Benchmark in VISSL 4 | 5 | --- 6 | 7 | # 🌟 New SSL Benchmark 8 | 9 | ## Approach description 10 | 11 | Important information only describing the benchmark, link to the arXiv paper describing the benchmark method. 12 | 13 | ## Open source status 14 | 15 | * [ ] the benchmark implementation is available: (give details) 16 | * [ ] the benchmark has been tested on few ssl approaches: (give details) 17 | * [ ] who are the authors: (mention them, if possible by @gh-username) 18 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/transforms/swav_train_only.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | TRANSFORMS: 6 | - name: RandomResizedCrop 7 | size: 224 8 | - name: RandomHorizontalFlip 9 | p: 0.5 10 | - name: ImgPilColorDistortion 11 | strength: 1.0 12 | - name: ImgPilGaussianBlur 13 | p: 0.5 14 | radius_min: 0.1 15 | radius_max: 2.0 16 | - name: ToTensor 17 | - name: Normalize 18 | mean: [0.485, 0.456, 0.406] 19 | std: [0.229, 0.224, 0.225] 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/regnet8Gf_swav_head.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_8gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"normalize_feats": False, "skip_last_bn": False, "use_bn": True, "dims": [2016, 4096], "num_clusters": []}], 11 | ['mlp', {'dims': [4096, 1000]}] 12 | ] 13 | DATA: 14 | # to reduce the training time, we use 64img/gpu (16GB machine) 15 | TRAIN: 16 | BATCHSIZE_PER_REPLICA: 64 17 | TEST: 18 | BATCHSIZE_PER_REPLICA: 64 19 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/regnet16Gf_swav_head.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"normalize_feats": False, "skip_last_bn": False, "use_bn": True, "dims": [3024, 4096], "num_clusters": []}], 11 | ['mlp', {'dims': [4096, 205]}] 12 | ] 13 | DATA: 14 | # to reduce the training time, we use 64img/gpu (16GB machine) 15 | TRAIN: 16 | BATCHSIZE_PER_REPLICA: 64 17 | TEST: 18 | BATCHSIZE_PER_REPLICA: 64 19 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/regnet32Gf_swav_head.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_32gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"normalize_feats": False, "skip_last_bn": False, "use_bn": True, "dims": [3712, 4096], "num_clusters": []}], 11 | ['mlp', {'dims': [4096, 205]}] 12 | ] 13 | DATA: 14 | # to reduce the training time, we use 64img/gpu (16GB machine) 15 | TRAIN: 16 | BATCHSIZE_PER_REPLICA: 64 17 | TEST: 18 | BATCHSIZE_PER_REPLICA: 64 19 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/regnet8Gf_swav_head.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_8gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"normalize_feats": False, "skip_last_bn": False, "use_bn": True, "dims": [2016, 4096], "num_clusters": []}], 11 | ['mlp', {'dims': [4096, 205]}] 12 | ] 13 | DATA: 14 | # to reduce the training time, we use 64img/gpu (16GB machine) 15 | TRAIN: 16 | BATCHSIZE_PER_REPLICA: 64 17 | TEST: 18 | BATCHSIZE_PER_REPLICA: 64 19 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | name: regnet_y_128gf 13 | HEAD: 14 | PARAMS: [['mlp', {'dims': [7392, 1000]}]] 15 | SYNC_BN_CONFIG: 16 | CONVERT_BN_TO_SYNC_BN: True 17 | SYNC_BN_TYPE: apex 18 | GROUP_SIZE: 8 19 | DISTRIBUTED: 20 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 21 | INIT_METHOD: tcp 22 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | name: regnet_y_128gf 13 | HEAD: 14 | PARAMS: [['mlp', {'dims': [7392, 205]}]] 15 | SYNC_BN_CONFIG: 16 | CONVERT_BN_TO_SYNC_BN: True 17 | SYNC_BN_TYPE: apex 18 | GROUP_SIZE: 8 19 | DISTRIBUTED: 20 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 21 | INIT_METHOD: tcp 22 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/regnet16Gf_swav_head.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"normalize_feats": False, "skip_last_bn": False, "use_bn": True, "dims": [3024, 4096], "num_clusters": []}], 11 | ['mlp', {'dims': [4096, 1000]}] 12 | ] 13 | DATA: 14 | # to reduce the training time, we use 64img/gpu (16GB machine) 15 | TRAIN: 16 | BATCHSIZE_PER_REPLICA: 64 17 | TEST: 18 | BATCHSIZE_PER_REPLICA: 64 19 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/regnet32Gf_swav_head.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_32gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"normalize_feats": False, "skip_last_bn": False, "use_bn": True, "dims": [3712, 4096], "num_clusters": []}], 11 | ['mlp', {'dims': [4096, 1000]}] 12 | ] 13 | DATA: 14 | # to reduce the training time, we use 64img/gpu (16GB machine) 15 | TRAIN: 16 | BATCHSIZE_PER_REPLICA: 64 17 | TEST: 18 | BATCHSIZE_PER_REPLICA: 64 19 | -------------------------------------------------------------------------------- /configs/config/feature_extraction/trunk_only/rn50_32x8d_layers.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | EVAL_MODE_ON: True 6 | FREEZE_TRUNK_ONLY: True 7 | EXTRACT_TRUNK_FEATURES_ONLY: True 8 | SHOULD_FLATTEN_FEATS: False 9 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 10 | ["res4", ["AvgPool2d", [[8, 8], 3, 0]]], 11 | ["res5", ["AvgPool2d", [[6, 6], 1, 0]]], 12 | ["res5avg", ["Identity", []]], 13 | ] 14 | TRUNK: 15 | NAME: resnet 16 | RESNETS: 17 | DEPTH: 50 18 | GROUPS: 32 19 | WIDTH_PER_GROUP: 8 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet16Gf_swav_d3024_d4096.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [3024, 4096], "use_bn": True, "num_clusters": []}], 11 | ['mlp', {'dims': [4096, 1000]}] 12 | ] 13 | # PARAMS: [['mlp', {'dims': [3024, 1000]}]] 14 | DATA: 15 | # to reduce the training time, we use 64img/gpu (16GB machine) 16 | TRAIN: 17 | BATCHSIZE_PER_REPLICA: 64 18 | TEST: 19 | BATCHSIZE_PER_REPLICA: 64 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | name: regnet_y_128gf 13 | HEAD: 14 | PARAMS: [['mlp', {'dims': [7392, 205]}]] 15 | SYNC_BN_CONFIG: 16 | CONVERT_BN_TO_SYNC_BN: True 17 | SYNC_BN_TYPE: apex 18 | GROUP_SIZE: 8 19 | DISTRIBUTED: 20 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 21 | INIT_METHOD: tcp 22 | -------------------------------------------------------------------------------- /configs/config/pretrain/datasets/imagenet.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | NUM_DATALOADER_WORKERS: 4 5 | TRAIN: 6 | DATA_SOURCES: [disk_folder] 7 | LABEL_SOURCES: [disk_folder] 8 | DATASET_NAMES: [imagenet1k_folder] 9 | MMAP_MODE: True 10 | COPY_TO_LOCAL_DISK: True 11 | COPY_DESTINATION_DIR: /tmp/imagenet1k/ 12 | TEST: 13 | DATA_SOURCES: [disk_folder] 14 | LABEL_SOURCES: [disk_folder] 15 | DATASET_NAMES: [imagenet1k_folder] 16 | MMAP_MODE: True 17 | COPY_TO_LOCAL_DISK: True 18 | COPY_DESTINATION_DIR: /tmp/imagenet1k/ 19 | MACHINE: 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | name: regnet_y_128gf 13 | HEAD: 14 | PARAMS: [['mlp', {'dims': [7392, 1000]}]] 15 | SYNC_BN_CONFIG: 16 | CONVERT_BN_TO_SYNC_BN: True 17 | SYNC_BN_TYPE: apex 18 | GROUP_SIZE: 8 19 | DISTRIBUTED: 20 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 21 | INIT_METHOD: tcp 22 | -------------------------------------------------------------------------------- /hydra_plugins/vissl_plugin/vissl_plugin.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from hydra.core.config_search_path import ConfigSearchPath 7 | from hydra.plugins.search_path_plugin import SearchPathPlugin 8 | 9 | 10 | class VisslPlugin(SearchPathPlugin): 11 | def manipulate_search_path(self, search_path: ConfigSearchPath) -> None: 12 | search_path.prepend(provider="vissl", path="pkg://configs") 13 | search_path.prepend(provider="vissl", path="file://configs") 14 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet16Gf_swav_d3024_d4096_d4096.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [3024, 4096, 4096], "use_bn": True, "num_clusters": []}], 11 | ['mlp', {'dims': [4096, 1000]}] 12 | ] 13 | # PARAMS: [['mlp', {'dims': [3024, 1000]}]] 14 | DATA: 15 | # to reduce the training time, we use 64img/gpu (16GB machine) 16 | TRAIN: 17 | BATCHSIZE_PER_REPLICA: 64 18 | TEST: 19 | BATCHSIZE_PER_REPLICA: 64 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/resnext50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | ######## resnext50-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext50-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext50-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | HEAD: 18 | PARAMS: [ 19 | ['swav_head', {'dims': [2048, 2048, 128], 'use_bn': True, 'num_clusters': []}] 20 | ] 21 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/resnext_d256.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | ######## resnext50-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext50-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext50-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | HEAD: 18 | PARAMS: [ 19 | ['swav_head', {'dims': [2048, 2048, 256], 'use_bn': True, 'num_clusters': []}] 20 | ] 21 | -------------------------------------------------------------------------------- /configs/config/test/integration_test/models/swav_regnet_fsdp.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: anynet 8 | depths: [2, 4, 11, 1] 9 | widths: [224, 448, 1232, 3024] 10 | group_widths: [112, 112, 112, 112] 11 | bottleneck_multipliers: [1.0, 1.0, 1.0, 1.0] 12 | strides: [2, 2, 2, 2] 13 | HEAD: 14 | PARAMS: [ 15 | ["swav_head", {"dims": [3024, 3024, 128], "use_bn": False, "num_clusters": [3000]}], 16 | ] 17 | SYNC_BN_CONFIG: 18 | CONVERT_BN_TO_SYNC_BN: True 19 | SYNC_BN_TYPE: pytorch 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/resnet50_w4.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: resnet 11 | RESNETS: 12 | DEPTH: 50 13 | WIDTH_MULTIPLIER: 4 14 | HEAD: 15 | PARAMS: [['mlp', {'dims': [8192, 205]}]] 16 | SYNC_BN_CONFIG: 17 | CONVERT_BN_TO_SYNC_BN: True 18 | SYNC_BN_TYPE: apex 19 | GROUP_SIZE: 8 20 | DISTRIBUTED: 21 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 22 | INIT_METHOD: tcp 23 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/swav/resnext101.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 101 8 | ######## resnext101-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext101-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext101-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | HEAD: 18 | PARAMS: [ 19 | ['swav_head', {'dims': [2048, 2048, 128], 'use_bn': True, 'num_clusters': []}] 20 | ] 21 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/resnet50_w4.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: resnet 11 | RESNETS: 12 | DEPTH: 50 13 | WIDTH_MULTIPLIER: 4 14 | HEAD: 15 | PARAMS: [['mlp', {'dims': [8192, 1000]}]] 16 | SYNC_BN_CONFIG: 17 | CONVERT_BN_TO_SYNC_BN: True 18 | SYNC_BN_TYPE: apex 19 | GROUP_SIZE: 8 20 | DISTRIBUTED: 21 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 22 | INIT_METHOD: tcp 23 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/models/alexnet_deepcluster.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | SHOULD_FLATTEN_FEATS: True 6 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 7 | ["conv1", ["AvgPool2d", [[19, 19], 4, 0]]], 8 | ["conv2", ["AvgPool2d", [[12, 12], 3, 0]]], 9 | ["conv3", ["AvgPool2d", [[9, 9], 1, 0]]], 10 | ["conv4", ["AvgPool2d", [[9, 9], 1, 0]]], 11 | ["conv5", ["AvgPool2d", [[8, 8], 1, 0]]], 12 | ] 13 | TRUNK: 14 | NAME: alexnet_deepcluster 15 | HEAD: 16 | PARAMS: [["mlp", {"dims": [9216, 20]}]] 17 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/resnet50_w4.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: resnet 11 | RESNETS: 12 | DEPTH: 50 13 | WIDTH_MULTIPLIER: 4 14 | HEAD: 15 | PARAMS: [['mlp', {'dims': [8192, 1000]}]] 16 | SYNC_BN_CONFIG: 17 | CONVERT_BN_TO_SYNC_BN: True 18 | SYNC_BN_TYPE: apex 19 | GROUP_SIZE: 8 20 | DISTRIBUTED: 21 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 22 | INIT_METHOD: tcp 23 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet16Gf_swav_d3024_d4096_lastBN.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [3024, 4096], "use_bn": True, "skip_last_bn": False, "num_clusters": []}], 11 | ['mlp', {'dims': [4096, 1000]}] 12 | ] 13 | # PARAMS: [['mlp', {'dims': [3024, 1000]}]] 14 | DATA: 15 | # to reduce the training time, we use 64img/gpu (16GB machine) 16 | TRAIN: 17 | BATCHSIZE_PER_REPLICA: 64 18 | TEST: 19 | BATCHSIZE_PER_REPLICA: 64 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/models/resnet50_w4.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["conv1", ['AdaptiveAvgPool2d', [[6, 6]]]], 7 | ["res2", ['AdaptiveAvgPool2d', [[3, 3]]]], 8 | ["res3", ['AdaptiveAvgPool2d', [[2, 2]]]], 9 | ["res4", ['AdaptiveAvgPool2d', [[1, 2]]]], 10 | ["res5", ['AdaptiveAvgPool2d', [[1, 1]]]] 11 | ] 12 | TRUNK: 13 | NAME: resnet 14 | RESNETS: 15 | DEPTH: 50 16 | WIDTH_MULTIPLIER: 4 17 | HEAD: 18 | PARAMS: [["mlp", {"dims": [8192, 20]}]] 19 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet16Gf_swav_d3024_d4096_noNorm.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [3024, 4096], "use_bn": True, "normalize_feats": False, "num_clusters": []}], 11 | ['mlp', {'dims': [4096, 1000]}] 12 | ] 13 | # PARAMS: [['mlp', {'dims': [3024, 1000]}]] 14 | DATA: 15 | # to reduce the training time, we use 64img/gpu (16GB machine) 16 | TRAIN: 17 | BATCHSIZE_PER_REPLICA: 64 18 | TEST: 19 | BATCHSIZE_PER_REPLICA: 64 20 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet # This could be overriden by command line to be regnet_fsdp 6 | REGNET: 7 | # The following is the same as the model "regnet_y_16gf: from ClassyVision/classy_vision/models/regnet.py 8 | depth: 18 9 | w_0: 200 10 | w_a: 106.23 11 | w_m: 2.48 12 | group_width: 112 13 | HEAD: 14 | PARAMS: [ 15 | ["swav_head", # This could be override by command line to be swav_head_fsdp 16 | {"dims": [3024, 3024, 128], "use_bn": False, "num_clusters": [3000]}], 17 | ] 18 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/models/resnet50_w2.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["conv1", ["AvgPool2d", [[20, 20], 13, 4]]], 7 | ["res2", ["AvgPool2d", [[32, 32], 8, 0]]], 8 | ["res3", ["AvgPool2d", [[13, 13], 7, 0]]], 9 | ["res4", ["AvgPool2d", [[8, 8], 6, 0]]], 10 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 11 | ] 12 | TRUNK: 13 | NAME: resnet 14 | RESNETS: 15 | DEPTH: 50 16 | WIDTH_MULTIPLIER: 2 17 | HEAD: 18 | PARAMS: [["mlp", {"dims": [4096, 20]}]] 19 | -------------------------------------------------------------------------------- /configs/config/extract_cluster/swav/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet # This could be overriden by command line to be regnet_fsdp 6 | REGNET: 7 | # The following is the same as the model "regnet_y_16gf: from ClassyVision/classy_vision/models/regnet.py 8 | depth: 18 9 | w_0: 200 10 | w_a: 106.23 11 | w_m: 2.48 12 | group_width: 112 13 | HEAD: 14 | PARAMS: [ 15 | ["swav_head", # This could be override by command line to be swav_head_fsdp 16 | {"dims": [3024, 3024, 128], "use_bn": False, "num_clusters": [3000]}], 17 | ] 18 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/simclr/resnext50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | ######## resnext50-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext50-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext50-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | HEAD: 18 | PARAMS: [ 19 | ["mlp", {"dims": [2048, 2048], "use_relu": True, "skip_last_layer_relu_bn": False}], 20 | ["mlp", {"dims": [2048, 128]}], 21 | ] 22 | -------------------------------------------------------------------------------- /configs/config/pretrain/deepcluster_v2/transforms/multicrop_2x160_4x96.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRANSFORMS: 5 | - name: ImgPilToMultiCrop 6 | total_num_crops: 6 7 | size_crops: [160, 96] 8 | num_crops: [2, 4] 9 | crop_scales: [[0.08, 1], [0.05, 0.14]] 10 | - name: RandomHorizontalFlip 11 | p: 0.5 12 | - name: ImgPilColorDistortion 13 | strength: 1.0 14 | - name: ImgPilGaussianBlur 15 | p: 0.5 16 | radius_min: 0.1 17 | radius_max: 2.0 18 | - name: ToTensor 19 | - name: Normalize 20 | mean: [0.485, 0.456, 0.406] 21 | std: [0.229, 0.224, 0.225] 22 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet16Gf_swav_d3024_d4096_lastBN_noNorm.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | name: regnet_y_16gf 8 | HEAD: 9 | PARAMS: [ 10 | ["swav_head", {"dims": [3024, 4096], "use_bn": True, "skip_last_bn": False, "normalize_feats": False, "num_clusters": []}], 11 | ['mlp', {'dims': [4096, 1000]}] 12 | ] 13 | # PARAMS: [['mlp', {'dims': [3024, 1000]}]] 14 | DATA: 15 | # to reduce the training time, we use 64img/gpu (16GB machine) 16 | TRAIN: 17 | BATCHSIZE_PER_REPLICA: 64 18 | TEST: 19 | BATCHSIZE_PER_REPLICA: 64 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/nearest_neighbor/models/simclr/resnext101.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 101 8 | ######## resnext101-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext101-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext101-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | HEAD: 18 | PARAMS: [ 19 | ["mlp", {"dims": [2048, 2048], "use_relu": True, "skip_last_layer_relu_bn": False}], 20 | ["mlp", {"dims": [2048, 128]}], 21 | ] 22 | -------------------------------------------------------------------------------- /configs/config/pretrain/npid/optimizations/bs32_4node_cosineLR.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | OPTIMIZER: 4 | name: sgd 5 | weight_decay: 0.0001 6 | momentum: 0.9 7 | num_epochs: 200 8 | # num_epochs: 400 9 | # num_epochs: 800 10 | nesterov: False 11 | regularize_bn: False 12 | regularize_bias: True 13 | param_schedulers: 14 | lr: 15 | name: cosine 16 | start_value: 0.12 # LR for batch size 256 17 | end_value: 0.00012 18 | update_interval: epoch 19 | DISTRIBUTED: 20 | BACKEND: nccl 21 | NUM_NODES: 4 22 | NUM_PROC_PER_NODE: 8 23 | INIT_METHOD: tcp 24 | NCCL_DEBUG: True 25 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/transforms/multicrop_2x224.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | TRANSFORMS: 6 | - name: ImgPilToMultiCrop 7 | total_num_crops: 2 8 | size_crops: [224] 9 | num_crops: [2] 10 | crop_scales: [[0.08, 1]] 11 | - name: RandomHorizontalFlip 12 | p: 0.5 13 | - name: ImgPilColorDistortion 14 | strength: 1.0 15 | - name: ImgPilGaussianBlur 16 | p: 0.5 17 | radius_min: 0.1 18 | radius_max: 2.0 19 | - name: ToTensor 20 | - name: Normalize 21 | mean: [0.485, 0.456, 0.406] 22 | std: [0.229, 0.224, 0.225] 23 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/models/resnet50_w3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ########## res50-w3 ############# 7 | ["conv1", ["AdaptiveAvgPool2d", [7]]], 8 | ["res2", ["AdaptiveAvgPool2d", [[4, 3]]]], 9 | ["res3", ["AdaptiveAvgPool2d", [[3, 2]]]], 10 | ["res4", ["AdaptiveAvgPool2d", [[3, 1]]]], 11 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 12 | ] 13 | TRUNK: 14 | NAME: resnet 15 | RESNETS: 16 | DEPTH: 50 17 | WIDTH_MULTIPLIER: 3 18 | 19 | HEAD: 20 | PARAMS: [["mlp", {"dims": [6144, 20]}]] 21 | -------------------------------------------------------------------------------- /configs/config/pretrain/jigsaw/optimization/bs32_4nodes.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | OPTIMIZER: 4 | num_epochs: 105 5 | param_schedulers: 6 | lr: 7 | name: composite 8 | schedulers: 9 | - name: linear 10 | start_value: 0.1 11 | end_value: 0.4 12 | - name: multistep 13 | values: [0.4, 0.04, 0.004, 0.0004, 0.00004] 14 | milestones: [30, 60, 90, 100] 15 | update_interval: step 16 | interval_scaling: [rescaled, fixed] 17 | lengths: [0.047619, 0.952381] 18 | DISTRIBUTED: 19 | BACKEND: nccl 20 | NUM_NODES: 4 21 | NUM_PROC_PER_NODE: 8 22 | INIT_METHOD: tcp 23 | NCCL_DEBUG: True 24 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet64Gf_3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | depth: 20 13 | w_0: 352 14 | w_a: 147.48 15 | w_m: 2.4 16 | group_width: 328 17 | HEAD: 18 | PARAMS: [['mlp', {'dims': [4920, 1000]}]] 19 | SYNC_BN_CONFIG: 20 | CONVERT_BN_TO_SYNC_BN: True 21 | SYNC_BN_TYPE: apex 22 | GROUP_SIZE: 8 23 | DISTRIBUTED: 24 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 25 | INIT_METHOD: tcp 26 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/regnet64Gf_3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | depth: 20 13 | w_0: 352 14 | w_a: 147.48 15 | w_m: 2.4 16 | group_width: 328 17 | HEAD: 18 | PARAMS: [['mlp', {'dims': [4920, 205]}]] 19 | SYNC_BN_CONFIG: 20 | CONVERT_BN_TO_SYNC_BN: True 21 | SYNC_BN_TYPE: apex 22 | GROUP_SIZE: 8 23 | DISTRIBUTED: 24 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 25 | INIT_METHOD: tcp 26 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["res4", ["AdaptiveAvgPool2d", [[3, 1]]]], 7 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 8 | ["avgpool", ["Identity", []]], 9 | ] 10 | TRUNK: 11 | NAME: regnet 12 | REGNET: 13 | name: regnet_y_128gf 14 | HEAD: 15 | PARAMS: [ 16 | ["eval_mlp", {"in_channels": 2904, "dims": [8712, 205]}], 17 | ["eval_mlp", {"in_channels": 7392, "dims": [14784, 205]}], 18 | ["eval_mlp", {"in_channels": 7392, "dims": [7392, 205]}], 19 | ] 20 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/COCOInstance/R50_C4_COCO/sBNExtraNorm_precBN_BGR_lrpt02_warm50_2x.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | MASK_ON: False 3 | RESNETS: 4 | DEPTH: 50 5 | NORM: "SyncBN" 6 | META_ARCHITECTURE: "GeneralizedRCNN" 7 | RPN: 8 | PRE_NMS_TOPK_TEST: 6000 9 | POST_NMS_TOPK_TEST: 1000 10 | ROI_HEADS: 11 | NAME: "Res5ROIHeadsExtraNorm" 12 | DATASETS: 13 | TRAIN: ("coco_2017_train",) 14 | TEST: ("coco_2017_val",) 15 | SOLVER: 16 | IMS_PER_BATCH: 16 17 | BASE_LR: 0.02 18 | STEPS: (120000, 160000) 19 | MAX_ITER: 180000 20 | WARMUP_ITERS: 50 21 | TEST: 22 | PRECISE_BN: 23 | ENABLED: True 24 | INPUT: 25 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 26 | VERSION: 2 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/regnet64Gf_3_swav_head.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | depth: 20 8 | w_0: 352 9 | w_a: 147.48 10 | w_m: 2.4 11 | group_width: 328 12 | HEAD: 13 | PARAMS: [ 14 | ["swav_head", {"normalize_feats": False, "skip_last_bn": False, "use_bn": True, "dims": [4920, 8192], "num_clusters": []}], 15 | ['mlp', {'dims': [8192, 1000]}] 16 | ] 17 | DATA: 18 | # to reduce the training time, we use 64img/gpu (16GB machine) 19 | TRAIN: 20 | BATCHSIZE_PER_REPLICA: 64 21 | TEST: 22 | BATCHSIZE_PER_REPLICA: 64 23 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/regnet64Gf_3_swav_head.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: regnet 6 | REGNET: 7 | depth: 20 8 | w_0: 352 9 | w_a: 147.48 10 | w_m: 2.4 11 | group_width: 328 12 | HEAD: 13 | PARAMS: [ 14 | ["swav_head", {"normalize_feats": False, "skip_last_bn": False, "use_bn": True, "dims": [4920, 8192], "num_clusters": []}], 15 | ['mlp', {'dims': [8192, 205]}] 16 | ] 17 | DATA: 18 | # to reduce the training time, we use 64img/gpu (16GB machine) 19 | TRAIN: 20 | BATCHSIZE_PER_REPLICA: 64 21 | TEST: 22 | BATCHSIZE_PER_REPLICA: 64 23 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet256Gf_1.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | depth: 27 13 | w_0: 640 14 | w_a: 230.83 15 | w_m: 2.53 16 | group_width: 373 17 | HEAD: 18 | PARAMS: [['mlp', {'dims': [10444, 1000]}]] 19 | SYNC_BN_CONFIG: 20 | CONVERT_BN_TO_SYNC_BN: True 21 | SYNC_BN_TYPE: apex 22 | GROUP_SIZE: 8 23 | DISTRIBUTED: 24 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 25 | INIT_METHOD: tcp 26 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/regnet64Gf_3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | depth: 20 13 | w_0: 352 14 | w_a: 147.48 15 | w_m: 2.4 16 | group_width: 328 17 | HEAD: 18 | PARAMS: [['mlp', {'dims': [4920, 205]}]] 19 | SYNC_BN_CONFIG: 20 | CONVERT_BN_TO_SYNC_BN: True 21 | SYNC_BN_TYPE: apex 22 | GROUP_SIZE: 16 23 | DISTRIBUTED: 24 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 25 | INIT_METHOD: tcp 26 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/resnext101_32x16d.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: resnet 11 | ######## resnext101-32x16d ####### 12 | RESNETS: 13 | DEPTH: 101 14 | GROUPS: 32 15 | WIDTH_PER_GROUP: 16 16 | HEAD: 17 | PARAMS: [['mlp', {'dims': [2048, 1000]}]] 18 | SYNC_BN_CONFIG: 19 | CONVERT_BN_TO_SYNC_BN: True 20 | SYNC_BN_TYPE: apex 21 | GROUP_SIZE: 8 22 | DISTRIBUTED: 23 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 24 | INIT_METHOD: tcp 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/places205/models/resnext101_32x16d.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: resnet 11 | ######## resnext101-32x16d ####### 12 | RESNETS: 13 | DEPTH: 101 14 | GROUPS: 32 15 | WIDTH_PER_GROUP: 16 16 | HEAD: 17 | PARAMS: [['mlp', {'dims': [2048, 205]}]] 18 | SYNC_BN_CONFIG: 19 | CONVERT_BN_TO_SYNC_BN: True 20 | SYNC_BN_TYPE: apex 21 | GROUP_SIZE: 8 22 | DISTRIBUTED: 23 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 24 | INIT_METHOD: tcp 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/regnet64Gf_3.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | depth: 20 13 | w_0: 352 14 | w_a: 147.48 15 | w_m: 2.4 16 | group_width: 328 17 | HEAD: 18 | PARAMS: [['mlp', {'dims': [4920, 1000]}]] 19 | SYNC_BN_CONFIG: 20 | CONVERT_BN_TO_SYNC_BN: True 21 | SYNC_BN_TYPE: apex 22 | GROUP_SIZE: 16 23 | DISTRIBUTED: 24 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 25 | INIT_METHOD: tcp 26 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/transforms/multicrop_6crop_6x160.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | TRANSFORMS: 6 | - name: ImgPilToMultiCrop 7 | total_num_crops: 6 8 | size_crops: [160] 9 | num_crops: [6] 10 | crop_scales: [[0.14, 1]] # imagenet 11 | - name: RandomHorizontalFlip 12 | p: 0.5 13 | - name: ImgPilColorDistortion 14 | strength: 1.0 15 | - name: ImgPilGaussianBlur 16 | p: 0.5 17 | radius_min: 0.1 18 | radius_max: 2.0 19 | - name: ToTensor 20 | - name: Normalize 21 | mean: [0.485, 0.456, 0.406] 22 | std: [0.229, 0.224, 0.225] 23 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/transforms/fixnet_320.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | TRANSFORMS: 6 | - name: Resize 7 | size: 438 8 | - name: RandomHorizontalFlip 9 | - name: CenterCrop 10 | size: 384 11 | - name: ToTensor 12 | - name: Normalize 13 | mean: [0.485, 0.456, 0.406] 14 | std: [0.229, 0.224, 0.225] 15 | TEST: 16 | TRANSFORMS: 17 | - name: Resize 18 | size: 438 19 | - name: CenterCrop 20 | size: 384 21 | - name: ToTensor 22 | - name: Normalize 23 | mean: [0.485, 0.456, 0.406] 24 | std: [0.229, 0.224, 0.225] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/transforms/fixnet_384.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | TRANSFORMS: 6 | - name: Resize 7 | size: 365 8 | - name: RandomHorizontalFlip 9 | - name: CenterCrop 10 | size: 320 11 | - name: ToTensor 12 | - name: Normalize 13 | mean: [0.485, 0.456, 0.406] 14 | std: [0.229, 0.224, 0.225] 15 | TEST: 16 | TRANSFORMS: 17 | - name: Resize 18 | size: 365 19 | - name: CenterCrop 20 | size: 320 21 | - name: ToTensor 22 | - name: Normalize 23 | mean: [0.485, 0.456, 0.406] 24 | std: [0.229, 0.224, 0.225] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/resnext101_32x16d.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: resnet 11 | ######## resnext101-32x16d ####### 12 | RESNETS: 13 | DEPTH: 101 14 | GROUPS: 32 15 | WIDTH_PER_GROUP: 16 16 | HEAD: 17 | PARAMS: [['mlp', {'dims': [2048, 205]}]] 18 | SYNC_BN_CONFIG: 19 | CONVERT_BN_TO_SYNC_BN: True 20 | SYNC_BN_TYPE: apex 21 | GROUP_SIZE: 16 22 | DISTRIBUTED: 23 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 24 | INIT_METHOD: tcp 25 | -------------------------------------------------------------------------------- /configs/config/feature_extraction/trunk_only/rn50_layers.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | EVAL_MODE_ON: True 6 | FREEZE_TRUNK_ONLY: True 7 | EXTRACT_TRUNK_FEATURES_ONLY: True 8 | SHOULD_FLATTEN_FEATS: False 9 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 10 | ["conv1", ["AvgPool2d", [[10, 10], 10, 4]]], 11 | ["res2", ["AvgPool2d", [[16, 16], 8, 0]]], 12 | ["res3", ["AvgPool2d", [[13, 13], 5, 0]]], 13 | ["res4", ["AvgPool2d", [[8, 8], 3, 0]]], 14 | ["res5", ["AvgPool2d", [[6, 6], 1, 0]]], 15 | ["res5avg", ["Identity", []]], 16 | ] 17 | TRUNK: 18 | NAME: resnet 19 | RESNETS: 20 | DEPTH: 50 21 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/resnext101_32x16d.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: resnet 11 | ######## resnext101-32x16d ####### 12 | RESNETS: 13 | DEPTH: 101 14 | GROUPS: 32 15 | WIDTH_PER_GROUP: 16 16 | HEAD: 17 | PARAMS: [['mlp', {'dims': [2048, 1000]}]] 18 | SYNC_BN_CONFIG: 19 | CONVERT_BN_TO_SYNC_BN: True 20 | SYNC_BN_TYPE: apex 21 | GROUP_SIZE: 16 22 | DISTRIBUTED: 23 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 24 | INIT_METHOD: tcp 25 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/transforms/multicrop_2x224_4x96.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | TRANSFORMS: 6 | - name: ImgPilToMultiCrop 7 | total_num_crops: 6 8 | size_crops: [224, 96] 9 | num_crops: [2, 4] 10 | crop_scales: [[0.14, 1], [0.05, 0.14]] 11 | - name: RandomHorizontalFlip 12 | p: 0.5 13 | - name: ImgPilColorDistortion 14 | strength: 1.0 15 | - name: ImgPilGaussianBlur 16 | p: 0.5 17 | radius_min: 0.1 18 | radius_max: 2.0 19 | - name: ToTensor 20 | - name: Normalize 21 | mean: [0.485, 0.456, 0.406] 22 | std: [0.229, 0.224, 0.225] 23 | -------------------------------------------------------------------------------- /configs/config/feature_extraction/trunk_only/regnet128Gf_res5.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | EVAL_MODE_ON: True 6 | FREEZE_TRUNK_ONLY: True 7 | EXTRACT_TRUNK_FEATURES_ONLY: True 8 | SHOULD_FLATTEN_FEATS: False 9 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 10 | ["flatten", ["Identity", []]], 11 | ] 12 | TRUNK: 13 | NAME: regnet # This could be overriden by command line to be regnet_fsdp 14 | REGNET: 15 | # The following is the same as the model "regnet_y_128gf: from ClassyVision/classy_vision/models/regnet.py 16 | depth: 27 17 | w_0: 456 18 | w_a: 160.83 19 | w_m: 2.52 20 | group_width: 264 21 | -------------------------------------------------------------------------------- /configs/config/feature_extraction/with_head/regnet128Gf_swav.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | EVAL_MODE_ON: True 6 | FREEZE_TRUNK_AND_HEAD: True 7 | EVAL_TRUNK_AND_HEAD: True 8 | TRUNK: 9 | NAME: regnet # This could be overriden by command line to be regnet_fsdp 10 | REGNET: 11 | # The following is the same as the model "regnet_y_128gf: from ClassyVision/classy_vision/models/regnet.py 12 | depth: 27 13 | w_0: 456 14 | w_a: 160.83 15 | w_m: 2.52 16 | group_width: 264 17 | HEAD: 18 | PARAMS: [ 19 | ["swav_head", {"dims": [7392, 7392, 128], "use_bn": False, "num_clusters": [3000]}], 20 | ] 21 | -------------------------------------------------------------------------------- /docs/source/api/meters.rst: -------------------------------------------------------------------------------- 1 | vissl.meters package 2 | =========================== 3 | 4 | 5 | vissl.meters.accuracy_list_meter 6 | ------------------------------------------- 7 | 8 | .. automodule:: vissl.meters.accuracy_list_meter 9 | :members: 10 | :undoc-members: 11 | :show-inheritance: 12 | 13 | 14 | vissl.meters.mean_ap_meter 15 | ------------------------------------------- 16 | 17 | .. automodule:: vissl.meters.mean_ap_meter 18 | :members: 19 | :undoc-members: 20 | :show-inheritance: 21 | 22 | 23 | vissl.meters.mean_ap_list_meter 24 | ------------------------------------------- 25 | 26 | .. automodule:: vissl.meters.mean_ap_list_meter 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/transforms/multicrop_6crop_2x160_4x96.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | TRANSFORMS: 6 | - name: ImgPilToMultiCrop 7 | total_num_crops: 6 8 | size_crops: [160, 96] 9 | num_crops: [2, 4] 10 | crop_scales: [[0.14, 1], [0.05, 0.14]] # imagenet 11 | - name: RandomHorizontalFlip 12 | p: 0.5 13 | - name: ImgPilColorDistortion 14 | strength: 1.0 15 | - name: ImgPilGaussianBlur 16 | p: 0.5 17 | radius_min: 0.1 18 | radius_max: 2.0 19 | - name: ToTensor 20 | - name: Normalize 21 | mean: [0.485, 0.456, 0.406] 22 | std: [0.229, 0.224, 0.225] 23 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/transforms/multicrop_6crop_2x224_4x96.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | TRANSFORMS: 6 | - name: ImgPilToMultiCrop 7 | total_num_crops: 6 8 | size_crops: [224, 96] 9 | num_crops: [2, 4] 10 | crop_scales: [[0.14, 1], [0.05, 0.14]] # imagenet 11 | - name: RandomHorizontalFlip 12 | p: 0.5 13 | - name: ImgPilColorDistortion 14 | strength: 1.0 15 | - name: ImgPilGaussianBlur 16 | p: 0.5 17 | radius_min: 0.1 18 | radius_max: 2.0 19 | - name: ToTensor 20 | - name: Normalize 21 | mean: [0.485, 0.456, 0.406] 22 | std: [0.229, 0.224, 0.225] 23 | -------------------------------------------------------------------------------- /dev/packaging/vissl_conda/README.md: -------------------------------------------------------------------------------- 1 | ## Building VISSL conda Packages 2 | 3 | 1. Ensure you are have a conda environment loaded which has anaconda-client 4 | and conda-build installed. 5 | 6 | 2. If you want the testing to work, make sure you have cuda 10.1 working as 7 | that is assumed by the testing phase. E.g. on the FAIR cluster 8 | ``` 9 | module purge 10 | module load cuda/10.1 11 | module load NCCL/2.7.6-1-cuda.10.1 12 | ``` 13 | 14 | 3. From the root of the repository run 15 | `bash dev/packaging/vissl_conda/build_all_conda.sh` to build the packages. 16 | 17 | 4. You can upload the packages to anaconda cloud by pasting your conda API 18 | token over the word `redacted` in `upload.sh` and then running 19 | `bash upload.sh` from this directory. 20 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | termcolor 2 | numpy 3 | tqdm 4 | docutils==0.16 5 | # https://github.com/sphinx-doc/sphinx/commit/7acd3ada3f38076af7b2b5c9f3b60bb9c2587a3d 6 | git+git://github.com/sphinx-doc/sphinx.git@7acd3ada3f38076af7b2b5c9f3b60bb9c2587a3d 7 | recommonmark==0.6.0 8 | sphinx_rtd_theme 9 | sphinx_markdown_tables 10 | mock 11 | opencv-python 12 | tensorboard 13 | hydra-core>=1.0 14 | faiss-gpu 15 | cython 16 | scikit-learn 17 | parameterized==0.7.4 18 | tabulate 19 | pycocotools>=2.0.1 20 | fvcore 21 | fairscale 22 | git+git://github.com/facebookresearch/ClassyVision.git 23 | https://download.pytorch.org/whl/cpu/torch-1.5.0%2Bcpu-cp37-cp37m-linux_x86_64.whl 24 | https://download.pytorch.org/whl/cpu/torchvision-0.6.0%2Bcpu-cp37-cp37m-linux_x86_64.whl 25 | -------------------------------------------------------------------------------- /configs/config/pretrain/pirl/models/resnet50_w2.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 2 9 | HEAD: 10 | PARAMS: [ 11 | # head 0 that operates on patches 12 | [ 13 | ["mlp", {"dims": [4096, 128], "use_bn": False, "use_relu": False}], 14 | ["siamese_concat_view", {"num_towers": 9}], 15 | ["mlp", {"dims": [1152, 128]}], 16 | ], 17 | # head 1 that operates on images. Linear projection. 18 | [ 19 | ["mlp", {"dims": [4096, 128]}] 20 | ], 21 | ] 22 | AMP_PARAMS: 23 | USE_AMP: True 24 | AMP_ARGS: {"opt_level": "O1"} 25 | OPTIMIZER: 26 | num_epochs: 400 27 | -------------------------------------------------------------------------------- /configs/config/pretrain/pirl/models/resnet50_w4.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | WIDTH_MULTIPLIER: 4 9 | HEAD: 10 | PARAMS: [ 11 | # head 0 that operates on patches 12 | [ 13 | ["mlp", {"dims": [8192, 128], "use_bn": False, "use_relu": False}], 14 | ["siamese_concat_view", {"num_towers": 9}], 15 | ["mlp", {"dims": [1152, 128]}], 16 | ], 17 | # head 1 that operates on images. Linear projection. 18 | [ 19 | ["mlp", {"dims": [8192, 128]}] 20 | ], 21 | ] 22 | AMP_PARAMS: 23 | USE_AMP: True 24 | AMP_ARGS: {"opt_level": "O1"} 25 | OPTIMIZER: 26 | num_epochs: 400 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/imagenet1k/models/regnet400MF.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 1 7 | topk_values: [1, 5] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res5", ["AdaptiveAvgPool2d", [[6, 5]]]], 12 | ] 13 | TRUNK: 14 | NAME: regnet 15 | REGNET: 16 | # Other regnet model names can be found in regnet.py inside 17 | # classy_vision directory. Remember to change the 18 | # dimensions in HEAD.PARAMS below accordingly. 19 | name: regnet_y_400mf 20 | HEAD: 21 | PARAMS: [ 22 | ["eval_mlp", {"in_channels": 440, "dims": [8640, 1000]}], 23 | ] 24 | -------------------------------------------------------------------------------- /docs/source/api/models.rst: -------------------------------------------------------------------------------- 1 | vissl.models package 2 | ======================= 3 | 4 | .. automodule:: vissl.models 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | 10 | vissl.models.model_helpers module 11 | --------------------------------------- 12 | 13 | .. automodule:: vissl.models.model_helpers 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | 18 | 19 | vissl.models.heads module 20 | --------------------------------------- 21 | 22 | .. automodule:: vissl.models.heads 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | 27 | 28 | vissl.models.trunks module 29 | --------------------------------------- 30 | 31 | .. automodule:: vissl.models.trunks 32 | :members: 33 | :undoc-members: 34 | :show-inheritance: 35 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/imagenet1k/models/efficientNet_B0.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 1 7 | topk_values: [1, 5] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["conv_final", ["AvgPool2d", [[5, 5], 1, 0]]], 12 | ] 13 | TRUNK: 14 | NAME: efficientnet 15 | EFFICIENT_NETS: 16 | model_version: B0 17 | bn_momentum: 0.01 18 | bn_epsilon: 0.001 19 | drop_connect_rate: 0.2 20 | width_divisor: 8 21 | min_width: null 22 | use_se: True 23 | HEAD: 24 | PARAMS: [ 25 | ["eval_mlp", {"in_channels": 1280, "dims": [11520, 1000]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/COCOInstance/R50_C4_COCO/d2_defaults.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | PIXEL_MEAN: [123.675, 116.280, 103.530] 3 | PIXEL_STD: [58.395, 57.120, 57.375] 4 | MASK_ON: False 5 | RESNETS: 6 | DEPTH: 50 7 | NORM: "SyncBN" 8 | STRIDE_IN_1X1: False 9 | META_ARCHITECTURE: "GeneralizedRCNN" 10 | RPN: 11 | PRE_NMS_TOPK_TEST: 6000 12 | POST_NMS_TOPK_TEST: 1000 13 | ROI_HEADS: 14 | NAME: "Res5ROIHeads" 15 | DATASETS: 16 | TRAIN: ("coco_2017_train",) 17 | TEST: ("coco_2017_val",) 18 | SOLVER: 19 | IMS_PER_BATCH: 16 20 | BASE_LR: 0.02 21 | STEPS: (60000, 80000) 22 | MAX_ITER: 90000 23 | TEST: 24 | PRECISE_BN: 25 | ENABLED: True 26 | INPUT: 27 | MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) 28 | FORMAT: "RGB" # torchvision models take RGB input 29 | VERSION: 2 30 | -------------------------------------------------------------------------------- /dev/benchmark_suite/benchmark_suite_scheduler_defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "params": { 3 | "evaluation_iter_freq": -1, 4 | "evaluation_phase_freq": -1, 5 | "evaluate_final_phase": true, 6 | "autoload_slurm_evaluator_checkpoint": false, 7 | "slurm_evaluator_checkpoint": null, 8 | "auto_retry_evaluations": false, 9 | "retry_evaluation_job_ids": [], 10 | "max_retries": 3, 11 | "pytorch_ports": [40050] 12 | }, 13 | "slurm_options": { 14 | "NAME": "vissl", 15 | "COMMENT": "vissl evaluation job", 16 | "CONSTRAINT": "", 17 | "TIMEOUT_MIN": 4320, 18 | "CPUS_PER_TASK": 8, 19 | "MEM_GB": 16, 20 | "ADDITIONAL_PARAMETERS": {} 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/models/regnet128Gf_swav_head.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | name: regnet_y_128gf 13 | HEAD: 14 | PARAMS: [ 15 | ["swav_head", {"normalize_feats": False, "skip_last_bn": False, "use_bn": True, "dims": [7392, 8192], "num_clusters": []}], 16 | ['mlp', {'dims': [8192, 1000]}] 17 | ] 18 | # PARAMS: [['mlp', {'dims': [7392, 1000]}]] 19 | SYNC_BN_CONFIG: 20 | CONVERT_BN_TO_SYNC_BN: True 21 | SYNC_BN_TYPE: pytorch 22 | DISTRIBUTED: 23 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 24 | INIT_METHOD: tcp 25 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/optimization/bs64_8node_cos_1restart_full.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | OPTIMIZER: 4 | num_epochs: 100 5 | param_schedulers: 6 | lr: 7 | auto_lr_scaling: 8 | auto_scale: false 9 | base_value: 0.3 10 | base_lr_batch_size: 256 11 | name: composite 12 | schedulers: 13 | - name: linear 14 | start_value: 0.6 15 | end_value: 4.8 16 | - name: cosine_warm_restart 17 | start_value: 4.8 18 | end_value: 0.0048 19 | wave_type: full 20 | restart_interval_length: 0.334 # half wave after the warmup is done 21 | update_interval: step 22 | interval_scaling: [rescaled, rescaled] 23 | lengths: [0.1, 0.9] # 100ep 24 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/optimization/bs64_8node_cos_1restart_half.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | OPTIMIZER: 4 | num_epochs: 100 5 | param_schedulers: 6 | lr: 7 | auto_lr_scaling: 8 | auto_scale: true 9 | base_value: 0.3 10 | base_lr_batch_size: 256 11 | name: composite 12 | schedulers: 13 | - name: linear 14 | start_value: 0.6 15 | end_value: 4.8 16 | - name: cosine_warm_restart 17 | start_value: 4.8 18 | end_value: 0.0048 19 | wave_type: half 20 | restart_interval_length: 0.5 # half wave after the warmup is done 21 | update_interval: step 22 | interval_scaling: [rescaled, rescaled] 23 | lengths: [0.1, 0.9] # 100ep 24 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/clevr_dist/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[6, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_8gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 896, "dims": [8064, 6]}], 22 | ["eval_mlp", {"in_channels": 2016, "dims": [12096, 6]}], 23 | ["eval_mlp", {"in_channels": 2016, "dims": [2016, 6]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/gtsrb/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[6, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_8gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 896, "dims": [8064, 43]}], 22 | ["eval_mlp", {"in_channels": 2016, "dims": [12096, 43]}], 23 | ["eval_mlp", {"in_channels": 2016, "dims": [2016, 43]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/kitti_dist/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[6, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_8gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 896, "dims": [8064, 4]}], 22 | ["eval_mlp", {"in_channels": 2016, "dims": [12096, 4]}], 23 | ["eval_mlp", {"in_channels": 2016, "dims": [2016, 4]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/clevr_count/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[7, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[3, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_32gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 1392, "dims": [9744, 8]}], 22 | ["eval_mlp", {"in_channels": 3712, "dims": [11136, 8]}], 23 | ["eval_mlp", {"in_channels": 3712, "dims": [3712, 8]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/clevr_count/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[6, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_8gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 896, "dims": [8064, 8]}], 22 | ["eval_mlp", {"in_channels": 2016, "dims": [12096, 8]}], 23 | ["eval_mlp", {"in_channels": 2016, "dims": [2016, 8]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/clevr_dist/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[7, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[3, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_32gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 1392, "dims": [9744, 6]}], 22 | ["eval_mlp", {"in_channels": 3712, "dims": [11136, 6]}], 23 | ["eval_mlp", {"in_channels": 3712, "dims": [3712, 6]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/dsprites/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[7, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[3, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_32gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 1392, "dims": [9744, 16]}], 22 | ["eval_mlp", {"in_channels": 3712, "dims": [11136, 16]}], 23 | ["eval_mlp", {"in_channels": 3712, "dims": [3712, 16]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/dsprites/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[6, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_8gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 896, "dims": [8064, 16]}], 22 | ["eval_mlp", {"in_channels": 2016, "dims": [12096, 16]}], 23 | ["eval_mlp", {"in_channels": 2016, "dims": [2016, 16]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/euro_sat/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[7, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[3, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_32gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 1392, "dims": [9744, 10]}], 22 | ["eval_mlp", {"in_channels": 3712, "dims": [11136, 10]}], 23 | ["eval_mlp", {"in_channels": 3712, "dims": [3712, 10]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/euro_sat/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[6, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_8gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 896, "dims": [8064, 10]}], 22 | ["eval_mlp", {"in_channels": 2016, "dims": [12096, 10]}], 23 | ["eval_mlp", {"in_channels": 2016, "dims": [2016, 10]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/gtsrb/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[7, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[3, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_32gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 1392, "dims": [9744, 43]}], 22 | ["eval_mlp", {"in_channels": 3712, "dims": [11136, 43]}], 23 | ["eval_mlp", {"in_channels": 3712, "dims": [3712, 43]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/kitti_dist/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[7, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[3, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_32gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 1392, "dims": [9744, 4]}], 22 | ["eval_mlp", {"in_channels": 3712, "dims": [11136, 4]}], 23 | ["eval_mlp", {"in_channels": 3712, "dims": [3712, 4]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/ucf101/models/regnet32Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[7, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[3, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_32gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 1392, "dims": [9744, 101]}], 22 | ["eval_mlp", {"in_channels": 3712, "dims": [11136, 101]}], 23 | ["eval_mlp", {"in_channels": 3712, "dims": [3712, 101]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/ucf101/models/regnet8Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[6, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | name: regnet_y_8gf 19 | HEAD: 20 | PARAMS: [ 21 | ["eval_mlp", {"in_channels": 896, "dims": [8064, 101]}], 22 | ["eval_mlp", {"in_channels": 2016, "dims": [12096, 101]}], 23 | ["eval_mlp", {"in_channels": 2016, "dims": [2016, 101]}], 24 | ] 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/transforms/resize320_224.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | NUM_DATALOADER_WORKERS: 5 5 | TRAIN: 6 | TRANSFORMS: 7 | - name: Resize 8 | size: 320 9 | - name: RandomResizedCrop 10 | size: 224 11 | - name: RandomHorizontalFlip 12 | - name: ToTensor 13 | - name: Normalize 14 | mean: [0.485, 0.456, 0.406] 15 | std: [0.229, 0.224, 0.225] 16 | TEST: 17 | TRANSFORMS: 18 | - name: Resize 19 | size: 320 20 | - name: Resize 21 | size: 256 22 | - name: CenterCrop 23 | size: 224 24 | - name: ToTensor 25 | - name: Normalize 26 | mean: [0.485, 0.456, 0.406] 27 | std: [0.229, 0.224, 0.225] 28 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/voc07/transforms/resize640_224.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | NUM_DATALOADER_WORKERS: 5 5 | TRAIN: 6 | TRANSFORMS: 7 | - name: Resize 8 | size: 640 9 | - name: RandomResizedCrop 10 | size: 224 11 | - name: RandomHorizontalFlip 12 | - name: ToTensor 13 | - name: Normalize 14 | mean: [0.485, 0.456, 0.406] 15 | std: [0.229, 0.224, 0.225] 16 | TEST: 17 | TRANSFORMS: 18 | - name: Resize 19 | size: 640 20 | - name: Resize 21 | size: 256 22 | - name: CenterCrop 23 | size: 224 24 | - name: ToTensor 25 | - name: Normalize 26 | mean: [0.485, 0.456, 0.406] 27 | std: [0.229, 0.224, 0.225] 28 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/models/resnext50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | ######## resnext50-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext50-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext50-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | ######## resnext50-32x32d ####### 18 | # GROUPS: 32 19 | # WIDTH_PER_GROUP: 32 20 | ######## resnext50-32x48d ####### 21 | # GROUPS: 32 22 | # WIDTH_PER_GROUP: 48 23 | HEAD: 24 | PARAMS: [ 25 | ["swav_head", {"dims": [2048, 2048, 128], "use_bn": True, "num_clusters": [3000]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/imagenet1k/transforms/resize320_224.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | NUM_DATALOADER_WORKERS: 5 5 | TRAIN: 6 | TRANSFORMS: 7 | - name: Resize 8 | size: 320 9 | - name: RandomResizedCrop 10 | size: 224 11 | - name: RandomHorizontalFlip 12 | - name: ToTensor 13 | - name: Normalize 14 | mean: [0.485, 0.456, 0.406] 15 | std: [0.229, 0.224, 0.225] 16 | TEST: 17 | TRANSFORMS: 18 | - name: Resize 19 | size: 320 20 | - name: Resize 21 | size: 256 22 | - name: CenterCrop 23 | size: 224 24 | - name: ToTensor 25 | - name: Normalize 26 | mean: [0.485, 0.456, 0.406] 27 | std: [0.229, 0.224, 0.225] 28 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/transforms/resize320_224.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | NUM_DATALOADER_WORKERS: 5 5 | TRAIN: 6 | TRANSFORMS: 7 | - name: Resize 8 | size: 320 9 | - name: RandomResizedCrop 10 | size: 224 11 | - name: RandomHorizontalFlip 12 | - name: ToTensor 13 | - name: Normalize 14 | mean: [0.485, 0.456, 0.406] 15 | std: [0.229, 0.224, 0.225] 16 | TEST: 17 | TRANSFORMS: 18 | - name: Resize 19 | size: 320 20 | - name: Resize 21 | size: 256 22 | - name: CenterCrop 23 | size: 224 24 | - name: ToTensor 25 | - name: Normalize 26 | mean: [0.485, 0.456, 0.406] 27 | std: [0.229, 0.224, 0.225] 28 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/inaturalist18/transforms/resize320_224.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | NUM_DATALOADER_WORKERS: 5 5 | TRAIN: 6 | TRANSFORMS: 7 | - name: Resize 8 | size: 320 9 | - name: RandomResizedCrop 10 | size: 224 11 | - name: RandomHorizontalFlip 12 | - name: ToTensor 13 | - name: Normalize 14 | mean: [0.485, 0.456, 0.406] 15 | std: [0.229, 0.224, 0.225] 16 | TEST: 17 | TRANSFORMS: 18 | - name: Resize 19 | size: 320 20 | - name: Resize 21 | size: 256 22 | - name: CenterCrop 23 | size: 224 24 | - name: ToTensor 25 | - name: Normalize 26 | mean: [0.485, 0.456, 0.406] 27 | std: [0.229, 0.224, 0.225] 28 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/models/resnext101.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 101 8 | ######## resnext101-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext101-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext101-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | ######## resnext101-32x32d ####### 18 | # GROUPS: 32 19 | # WIDTH_PER_GROUP: 32 20 | ######## resnext101-32x48d ####### 21 | # GROUPS: 32 22 | # WIDTH_PER_GROUP: 48 23 | HEAD: 24 | PARAMS: [ 25 | ["swav_head", {"dims": [2048, 2048, 128], "use_bn": True, "num_clusters": [3000]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/imagenet1k/models/regnet128Gf_swav_head.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | name: regnet_y_128gf 13 | HEAD: 14 | PARAMS: [ 15 | ["swav_head", {"normalize_feats": False, "skip_last_bn": False, "use_bn": True, "dims": [7392, 8192], "num_clusters": []}], 16 | ['mlp', {'dims': [8192, 1000]}] 17 | ] 18 | # PARAMS: [['mlp', {'dims': [7392, 1000]}]] 19 | SYNC_BN_CONFIG: 20 | CONVERT_BN_TO_SYNC_BN: True 21 | SYNC_BN_TYPE: apex 22 | GROUP_SIZE: 8 23 | DISTRIBUTED: 24 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 25 | INIT_METHOD: tcp 26 | -------------------------------------------------------------------------------- /configs/config/benchmark/semi_supervised/places205/models/regnet128Gf_swav_head.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | BATCHSIZE_PER_REPLICA: 16 6 | TEST: 7 | BATCHSIZE_PER_REPLICA: 16 8 | MODEL: 9 | TRUNK: 10 | NAME: regnet 11 | REGNET: 12 | name: regnet_y_128gf 13 | HEAD: 14 | PARAMS: [ 15 | ["swav_head", {"normalize_feats": False, "skip_last_bn": False, "use_bn": True, "dims": [7392, 8192], "num_clusters": []}], 16 | ['mlp', {'dims': [8192, 205]}] 17 | ] 18 | # PARAMS: [['mlp', {'dims': [7392, 1000]}]] 19 | SYNC_BN_CONFIG: 20 | CONVERT_BN_TO_SYNC_BN: True 21 | SYNC_BN_TYPE: apex 22 | GROUP_SIZE: 8 23 | DISTRIBUTED: 24 | NUM_NODES: 2 # we can't fit the model on 16GB machine so instead use 2 nodes 25 | INIT_METHOD: tcp 26 | -------------------------------------------------------------------------------- /dev/packaging/apex_conda/README.md: -------------------------------------------------------------------------------- 1 | ## Building Nvidia apex conda Packages 2 | 3 | This does not use anything outside this directory. 4 | It is a standalone set of code to build conda packages 5 | for apex. 6 | 7 | 1. Make sure this directory is on a filesystem which docker can 8 | use - e.g. not NFS. If you are using a local hard drive there is 9 | nothing to do here. 10 | 11 | 2. Go into the `inside` directory and clone apex with 12 | `git clone https://github.com/NVIDIA/apex.git`. 13 | 14 | 3. You may want to `docker pull pytorch/conda-cuda:latest`. 15 | 16 | 4. Run `bash go.sh` in this directory. This takes ages 17 | and writes packages to `inside/packaging`. 18 | 19 | 5. You can upload the packages to anaconda cloud by pasting your conda API 20 | token over the word `redacted` in `upload.sh` and then running 21 | `bash upload.sh` from this directory. 22 | -------------------------------------------------------------------------------- /dev/packaging/vissl_pip/test/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | set -ex 8 | 9 | conda init bash 10 | # shellcheck source=/dev/null 11 | source ~/.bashrc 12 | 13 | conda create -y -n myenv python=3.7 opencv 14 | conda activate myenv 15 | conda install -y -c pytorch pytorch=1.5.1 cudatoolkit=10.1 torchvision 16 | 17 | pip install -f https://dl.fbaipublicfiles.com/vissl/packaging/apexwheels/py37_cu101_pyt151/download.html apex 18 | #pip install vissl --no-index -f https://dl.fbaipublicfiles.com/vissl/packaging/visslwheels/download.html 19 | pip install vissl 20 | python -c "import vissl, apex" 21 | cd loc1 22 | python -m unittest discover -v -s tests 23 | dev/run_quick_tests.sh 24 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/optimization/bs64_8node_cos_1restart_half_adaptive.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | OPTIMIZER: 4 | num_epochs: 100 5 | param_schedulers: 6 | lr: 7 | auto_lr_scaling: 8 | auto_scale: true 9 | base_value: 0.3 10 | base_lr_batch_size: 256 11 | name: composite 12 | schedulers: 13 | - name: linear 14 | start_value: 0.6 15 | end_value: 4.8 16 | - name: cosine_warm_restart 17 | start_value: 4.8 18 | end_value: 0.0048 19 | restart_interval_length: 0.5 # half wave after the warmup is done 20 | wave_type: half 21 | is_adaptive: True 22 | update_interval: step 23 | interval_scaling: [rescaled, rescaled] 24 | lengths: [0.1, 0.9] # 100ep 25 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/voc0712/cvpr21_scale/RX101-32x8d_VOC0712/d2_defaults_BGR.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | META_ARCHITECTURE: "GeneralizedRCNN" 3 | MASK_ON: False 4 | RPN: 5 | PRE_NMS_TOPK_TEST: 6000 6 | POST_NMS_TOPK_TEST: 1000 7 | WEIGHTS: "" 8 | ROI_HEADS: 9 | NAME: "Res5ROIHeads" 10 | NUM_CLASSES: 20 11 | BACKBONE: 12 | FREEZE_AT: 0 13 | RESNETS: 14 | DEPTH: 101 15 | NUM_GROUPS: 32 16 | WIDTH_PER_GROUP: 8 17 | STRIDE_IN_1X1: False 18 | INPUT: 19 | MIN_SIZE_TRAIN: (480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800) 20 | MIN_SIZE_TEST: 800 21 | DATASETS: 22 | TRAIN: ('voc_2007_trainval', 'voc_2012_trainval') 23 | TEST: ('voc_2007_test',) 24 | TEST: 25 | PRECISE_BN: 26 | ENABLED: True 27 | SOLVER: 28 | STEPS: (12000, 16000) 29 | MAX_ITER: 18000 30 | WARMUP_ITERS: 100 31 | IMS_PER_BATCH: 16 32 | -------------------------------------------------------------------------------- /configs/config/pretrain/swav/optimization/bs64_8node_cos_1restart_full_adaptive.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | OPTIMIZER: 4 | num_epochs: 100 5 | param_schedulers: 6 | lr: 7 | auto_lr_scaling: 8 | auto_scale: true 9 | base_value: 0.3 10 | base_lr_batch_size: 256 11 | name: composite 12 | schedulers: 13 | - name: linear 14 | start_value: 0.6 15 | end_value: 4.8 16 | - name: cosine_warm_restart 17 | start_value: 4.8 18 | end_value: 0.0048 19 | restart_interval_length: 0.334 # half wave after the warmup is done 20 | wave_type: full 21 | is_adaptive: True 22 | update_interval: step 23 | interval_scaling: [rescaled, rescaled] 24 | lengths: [0.1, 0.9] # 100ep 25 | -------------------------------------------------------------------------------- /dev/packaging/vissl_conda/build_all_conda.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | set -ex 8 | 9 | rm -rf dev/packaging/vissl_conda/ClassyVision 10 | git clone https://github.com/facebookresearch/ClassyVision.git dev/packaging/vissl_conda/ClassyVision 11 | rm -rf dev/packaging/vissl_conda/fairscale 12 | git clone https://github.com/facebookresearch/fairscale.git dev/packaging/vissl_conda/fairscale 13 | rm -rf classy_vision 14 | cp -r dev/packaging/vissl_conda/ClassyVision/classy_vision classy_vision 15 | rm -rf fairscale 16 | cp -r dev/packaging/vissl_conda/fairscale/fairscale fairscale 17 | 18 | for PV in 3.6 3.7 3.8 19 | do 20 | PYTHON_VERSION=$PV bash dev/packaging/vissl_conda/build_conda.sh 21 | done 22 | -------------------------------------------------------------------------------- /vissl/models/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from vissl.models.base_ssl_model import BaseSSLMultiInputOutputModel 7 | from vissl.models.model_helpers import ( # noqa 8 | convert_sync_bn, 9 | is_feature_extractor_model, 10 | ) 11 | 12 | 13 | def build_model(model_config, optimizer_config): 14 | """ 15 | Given the model config and the optimizer config, construct the model. 16 | The returned model is not copied to gpu yet (if using gpu) and neither 17 | wrapped with DDP yet. This is done later train_task.py .prepare() 18 | """ 19 | return BaseSSLMultiInputOutputModel(model_config, optimizer_config) 20 | 21 | 22 | __all__ = [k for k in globals().keys() if not k.startswith("_")] 23 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/models/resnext50.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 50 8 | ######## resnext50-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext50-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext50-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | ######## resnext50-32x32d ####### 18 | # GROUPS: 32 19 | # WIDTH_PER_GROUP: 32 20 | ######## resnext50-32x48d ####### 21 | # GROUPS: 32 22 | # WIDTH_PER_GROUP: 48 23 | HEAD: 24 | PARAMS: [ 25 | ["mlp", {"dims": [2048, 2048], "use_relu": True, "skip_last_layer_relu_bn": False}], 26 | ["mlp", {"dims": [2048, 128]}], 27 | ] 28 | -------------------------------------------------------------------------------- /configs/config/pretrain/simclr/models/resnext101.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | TRUNK: 5 | NAME: resnet 6 | RESNETS: 7 | DEPTH: 101 8 | ######## resnext101-32x4d ####### 9 | # GROUPS: 32 10 | # WIDTH_PER_GROUP: 4 11 | ######## resnext101-32x8d ####### 12 | # GROUPS: 32 13 | # WIDTH_PER_GROUP: 8 14 | ######## resnext101-32x16d ####### 15 | # GROUPS: 32 16 | # WIDTH_PER_GROUP: 16 17 | ######## resnext101-32x32d ####### 18 | # GROUPS: 32 19 | # WIDTH_PER_GROUP: 32 20 | ######## resnext101-32x48d ####### 21 | # GROUPS: 32 22 | # WIDTH_PER_GROUP: 48 23 | HEAD: 24 | PARAMS: [ 25 | ["mlp", {"dims": [2048, 2048], "use_relu": True, "skip_last_layer_relu_bn": False}], 26 | ["mlp", {"dims": [2048, 128]}], 27 | ] 28 | -------------------------------------------------------------------------------- /configs/config/benchmark/object_detection/voc0712/iccv19/rn50_transfer_voc0712_detectron2_e2e.yaml: -------------------------------------------------------------------------------- 1 | MODEL: 2 | META_ARCHITECTURE: "GeneralizedRCNN" 3 | PIXEL_MEAN: [123.675, 116.280, 103.530] 4 | PIXEL_STD: [58.395, 57.120, 57.375] 5 | MASK_ON: False 6 | RPN: 7 | PRE_NMS_TOPK_TEST: 6000 8 | POST_NMS_TOPK_TEST: 1000 9 | WEIGHTS: "specify weights" 10 | ROI_HEADS: 11 | NAME: "Res5ROIHeads" 12 | NUM_CLASSES: 20 13 | RESNETS: 14 | DEPTH: 50 15 | STRIDE_IN_1X1: False 16 | INPUT: 17 | MIN_SIZE_TRAIN: (480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800) 18 | MIN_SIZE_TEST: 800 19 | FORMAT: "RGB" # torchvision models take RGB input 20 | DATASETS: 21 | TRAIN: ('voc_2007_trainval', 'voc_2012_trainval') 22 | TEST: ('voc_2007_test',) 23 | SOLVER: 24 | STEPS: (17000,) 25 | MAX_ITER: 25000 26 | WARMUP_ITERS: 100 27 | IMS_PER_BATCH: 16 28 | BASE_LR: 0.02 29 | -------------------------------------------------------------------------------- /docs/source/api/trainer.rst: -------------------------------------------------------------------------------- 1 | vissl.trainer package 2 | ========================================== 3 | 4 | .. automodule:: vissl.trainer.trainer_main 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | vissl.train_task package 10 | --------------------------------------- 11 | 12 | .. automodule:: vissl.trainer.train_task 13 | :members: 14 | :undoc-members: 15 | :show-inheritance: 16 | 17 | vissl.trainer.train_steps module 18 | --------------------------------------- 19 | 20 | .. automodule:: vissl.trainer.train_steps 21 | :members: 22 | :undoc-members: 23 | :show-inheritance: 24 | 25 | 26 | vissl.trainer.train_steps.standard_train_step module 27 | ------------------------------------------------------- 28 | 29 | .. automodule:: vissl.trainer.train_steps.standard_train_step 30 | :members: 31 | :undoc-members: 32 | :show-inheritance: 33 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/places205/models/alexnet_rotnet.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["conv1", ["AdaptiveMaxPool2d", [12]]], 7 | ["conv2", ["AdaptiveMaxPool2d", [7]]], 8 | ["conv3", ["AdaptiveMaxPool2d", [5]]], 9 | ["conv4", ["AdaptiveMaxPool2d", [6]]], 10 | ["conv5", ["AdaptiveMaxPool2d", [6]]], 11 | ] 12 | TRUNK: 13 | NAME: alexnet_rotnet 14 | HEAD: 15 | PARAMS: [ 16 | ["eval_mlp", {"in_channels": 64, "dims": [9216, 205]}], 17 | ["eval_mlp", {"in_channels": 192, "dims": [9408, 205]}], 18 | ["eval_mlp", {"in_channels": 384, "dims": [9600, 205]}], 19 | ["eval_mlp", {"in_channels": 256, "dims": [9216, 205]}], 20 | ["eval_mlp", {"in_channels": 256, "dims": [9216, 205]}], 21 | ] 22 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/gtsrb/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 4 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[4, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ["avgpool", ["Identity", []]], 15 | ] 16 | TRUNK: 17 | NAME: regnet 18 | REGNET: 19 | name: regnet_y_16gf 20 | HEAD: 21 | PARAMS: [ 22 | ["eval_mlp", {"in_channels": 1232, "dims": [11088, 43]}], 23 | ["eval_mlp", {"in_channels": 3024, "dims": [12096, 43]}], 24 | ["eval_mlp", {"in_channels": 3024, "dims": [3024, 43]}], 25 | ["mlp", {"dims": [3024, 43]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/gtsrb/models/regnet64Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[5, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | depth: 20 19 | w_0: 352 20 | w_a: 147.48 21 | w_m: 2.4 22 | group_width: 328 23 | HEAD: 24 | PARAMS: [ 25 | ["eval_mlp", {"in_channels": 1968, "dims": [9840, 43]}], 26 | ["eval_mlp", {"in_channels": 4920, "dims": [9840, 43]}], 27 | ["eval_mlp", {"in_channels": 4920, "dims": [4920, 43]}], 28 | ] 29 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/transforms/fixnet_320_swav.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | TRANSFORMS: 6 | - name: Resize 7 | size: 438 8 | - name: RandomHorizontalFlip 9 | - name: ImgPilColorDistortion 10 | strength: 1.0 11 | - name: ImgPilGaussianBlur 12 | p: 0.5 13 | radius_min: 0.1 14 | radius_max: 2.0 15 | - name: CenterCrop 16 | size: 384 17 | - name: ToTensor 18 | - name: Normalize 19 | mean: [0.485, 0.456, 0.406] 20 | std: [0.229, 0.224, 0.225] 21 | TEST: 22 | TRANSFORMS: 23 | - name: Resize 24 | size: 438 25 | - name: CenterCrop 26 | size: 384 27 | - name: ToTensor 28 | - name: Normalize 29 | mean: [0.485, 0.456, 0.406] 30 | std: [0.229, 0.224, 0.225] 31 | -------------------------------------------------------------------------------- /configs/config/benchmark/fulltune/imagenet1k/transforms/fixnet_384_swav.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | DATA: 4 | TRAIN: 5 | TRANSFORMS: 6 | - name: Resize 7 | size: 365 8 | - name: RandomHorizontalFlip 9 | - name: ImgPilColorDistortion 10 | strength: 1.0 11 | - name: ImgPilGaussianBlur 12 | p: 0.5 13 | radius_min: 0.1 14 | radius_max: 2.0 15 | - name: CenterCrop 16 | size: 320 17 | - name: ToTensor 18 | - name: Normalize 19 | mean: [0.485, 0.456, 0.406] 20 | std: [0.229, 0.224, 0.225] 21 | TEST: 22 | TRANSFORMS: 23 | - name: Resize 24 | size: 365 25 | - name: CenterCrop 26 | size: 320 27 | - name: ToTensor 28 | - name: Normalize 29 | mean: [0.485, 0.456, 0.406] 30 | std: [0.229, 0.224, 0.225] 31 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/clevr_count/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 4 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ["avgpool", ["Identity", []]], 15 | ] 16 | TRUNK: 17 | NAME: regnet 18 | REGNET: 19 | name: regnet_y_128gf 20 | HEAD: 21 | PARAMS: [ 22 | ["eval_mlp", {"in_channels": 2904, "dims": [8712, 8]}], 23 | ["eval_mlp", {"in_channels": 7392, "dims": [14784, 8]}], 24 | ["eval_mlp", {"in_channels": 7392, "dims": [7392, 8]}], 25 | ["mlp", {"dims": [7392, 8]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/clevr_count/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 4 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[4, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ["avgpool", ["Identity", []]], 15 | ] 16 | TRUNK: 17 | NAME: regnet 18 | REGNET: 19 | name: regnet_y_16gf 20 | HEAD: 21 | PARAMS: [ 22 | ["eval_mlp", {"in_channels": 1232, "dims": [11088, 8]}], 23 | ["eval_mlp", {"in_channels": 3024, "dims": [12096, 8]}], 24 | ["eval_mlp", {"in_channels": 3024, "dims": [3024, 8]}], 25 | ["mlp", {"dims": [3024, 8]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/clevr_count/models/regnet64Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[5, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | depth: 20 19 | w_0: 352 20 | w_a: 147.48 21 | w_m: 2.4 22 | group_width: 328 23 | HEAD: 24 | PARAMS: [ 25 | ["eval_mlp", {"in_channels": 1968, "dims": [9840, 8]}], 26 | ["eval_mlp", {"in_channels": 4920, "dims": [9840, 8]}], 27 | ["eval_mlp", {"in_channels": 4920, "dims": [4920, 8]}], 28 | ] 29 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/clevr_dist/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 4 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ["avgpool", ["Identity", []]], 15 | ] 16 | TRUNK: 17 | NAME: regnet 18 | REGNET: 19 | name: regnet_y_128gf 20 | HEAD: 21 | PARAMS: [ 22 | ["eval_mlp", {"in_channels": 2904, "dims": [8712, 6]}], 23 | ["eval_mlp", {"in_channels": 7392, "dims": [14784, 6]}], 24 | ["eval_mlp", {"in_channels": 7392, "dims": [7392, 6]}], 25 | ["mlp", {"dims": [7392, 6]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/clevr_dist/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 4 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[4, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ["avgpool", ["Identity", []]], 15 | ] 16 | TRUNK: 17 | NAME: regnet 18 | REGNET: 19 | name: regnet_y_16gf 20 | HEAD: 21 | PARAMS: [ 22 | ["eval_mlp", {"in_channels": 1232, "dims": [11088, 6]}], 23 | ["eval_mlp", {"in_channels": 3024, "dims": [12096, 6]}], 24 | ["eval_mlp", {"in_channels": 3024, "dims": [3024, 6]}], 25 | ["mlp", {"dims": [3024, 6]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/clevr_dist/models/regnet64Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[5, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | depth: 20 19 | w_0: 352 20 | w_a: 147.48 21 | w_m: 2.4 22 | group_width: 328 23 | HEAD: 24 | PARAMS: [ 25 | ["eval_mlp", {"in_channels": 1968, "dims": [9840, 6]}], 26 | ["eval_mlp", {"in_channels": 4920, "dims": [9840, 6]}], 27 | ["eval_mlp", {"in_channels": 4920, "dims": [4920, 6]}], 28 | ] 29 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/dsprites/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 4 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ["avgpool", ["Identity", []]], 15 | ] 16 | TRUNK: 17 | NAME: regnet 18 | REGNET: 19 | name: regnet_y_128gf 20 | HEAD: 21 | PARAMS: [ 22 | ["eval_mlp", {"in_channels": 2904, "dims": [8712, 16]}], 23 | ["eval_mlp", {"in_channels": 7392, "dims": [14784, 16]}], 24 | ["eval_mlp", {"in_channels": 7392, "dims": [7392, 16]}], 25 | ["mlp", {"dims": [7392, 16]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/dsprites/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 4 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[4, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ["avgpool", ["Identity", []]], 15 | ] 16 | TRUNK: 17 | NAME: regnet 18 | REGNET: 19 | name: regnet_y_16gf 20 | HEAD: 21 | PARAMS: [ 22 | ["eval_mlp", {"in_channels": 1232, "dims": [11088, 16]}], 23 | ["eval_mlp", {"in_channels": 3024, "dims": [12096, 16]}], 24 | ["eval_mlp", {"in_channels": 3024, "dims": [3024, 16]}], 25 | ["mlp", {"dims": [3024, 16]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/dsprites/models/regnet64Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[5, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | depth: 20 19 | w_0: 352 20 | w_a: 147.48 21 | w_m: 2.4 22 | group_width: 328 23 | HEAD: 24 | PARAMS: [ 25 | ["eval_mlp", {"in_channels": 1968, "dims": [9840, 16]}], 26 | ["eval_mlp", {"in_channels": 4920, "dims": [9840, 16]}], 27 | ["eval_mlp", {"in_channels": 4920, "dims": [4920, 16]}], 28 | ] 29 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/euro_sat/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 4 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ["avgpool", ["Identity", []]], 15 | ] 16 | TRUNK: 17 | NAME: regnet 18 | REGNET: 19 | name: regnet_y_128gf 20 | HEAD: 21 | PARAMS: [ 22 | ["eval_mlp", {"in_channels": 2904, "dims": [8712, 10]}], 23 | ["eval_mlp", {"in_channels": 7392, "dims": [14784, 10]}], 24 | ["eval_mlp", {"in_channels": 7392, "dims": [7392, 10]}], 25 | ["mlp", {"dims": [7392, 10]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/euro_sat/models/regnet16Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 4 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 3]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[4, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ["avgpool", ["Identity", []]], 15 | ] 16 | TRUNK: 17 | NAME: regnet 18 | REGNET: 19 | name: regnet_y_16gf 20 | HEAD: 21 | PARAMS: [ 22 | ["eval_mlp", {"in_channels": 1232, "dims": [11088, 10]}], 23 | ["eval_mlp", {"in_channels": 3024, "dims": [12096, 10]}], 24 | ["eval_mlp", {"in_channels": 3024, "dims": [3024, 10]}], 25 | ["mlp", {"dims": [3024, 10]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/euro_sat/models/regnet64Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[5, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | depth: 20 19 | w_0: 352 20 | w_a: 147.48 21 | w_m: 2.4 22 | group_width: 328 23 | HEAD: 24 | PARAMS: [ 25 | ["eval_mlp", {"in_channels": 1968, "dims": [9840, 10]}], 26 | ["eval_mlp", {"in_channels": 4920, "dims": [9840, 10]}], 27 | ["eval_mlp", {"in_channels": 4920, "dims": [4920, 10]}], 28 | ] 29 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/gtsrb/models/regnet128Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 4 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[3, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[2, 1]]]], 13 | ["avgpool", ["Identity", []]], 14 | ["avgpool", ["Identity", []]], 15 | ] 16 | TRUNK: 17 | NAME: regnet 18 | REGNET: 19 | name: regnet_y_128gf 20 | HEAD: 21 | PARAMS: [ 22 | ["eval_mlp", {"in_channels": 2904, "dims": [8712, 43]}], 23 | ["eval_mlp", {"in_channels": 7392, "dims": [14784, 43]}], 24 | ["eval_mlp", {"in_channels": 7392, "dims": [7392, 43]}], 25 | ["mlp", {"dims": [7392, 43]}], 26 | ] 27 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/gtsrb/models/regnet256Gf.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | METERS: 4 | name: accuracy_list_meter 5 | accuracy_list_meter: 6 | num_meters: 3 7 | topk_values: [1] 8 | MODEL: 9 | FEATURE_EVAL_SETTINGS: 10 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 11 | ["res4", ["AdaptiveAvgPool2d", [[2, 1]]]], 12 | ["res5", ["AdaptiveAvgPool2d", [[1, 2]]]], 13 | ["avgpool", ["Identity", []]], 14 | ] 15 | TRUNK: 16 | NAME: regnet 17 | REGNET: 18 | depth: 27 19 | w_0: 640 20 | w_a: 230.83 21 | w_m: 2.53 22 | group_width: 373 23 | HEAD: 24 | PARAMS: [ 25 | ["eval_mlp", {"in_channels": 4103, "dims": [8206, 43]}], 26 | ["eval_mlp", {"in_channels": 10444, "dims": [20888, 43]}], 27 | ["eval_mlp", {"in_channels": 10444, "dims": [10444, 43]}], 28 | ] 29 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/imagenet1k/models/alexnet_rotnet.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | MODEL: 4 | FEATURE_EVAL_SETTINGS: 5 | LINEAR_EVAL_FEAT_POOL_OPS_MAP: [ 6 | ["conv1", ["AdaptiveMaxPool2d", [12]]], 7 | ["conv2", ["AdaptiveMaxPool2d", [7]]], 8 | ["conv3", ["AdaptiveMaxPool2d", [5]]], 9 | ["conv4", ["AdaptiveMaxPool2d", [6]]], 10 | ["conv5", ["AdaptiveMaxPool2d", [6]]], 11 | ] 12 | TRUNK: 13 | NAME: alexnet_rotnet 14 | HEAD: 15 | PARAMS: [ 16 | ["eval_mlp", {"in_channels": 64, "dims": [9216, 1000]}], 17 | ["eval_mlp", {"in_channels": 192, "dims": [9408, 1000]}], 18 | ["eval_mlp", {"in_channels": 384, "dims": [9600, 1000]}], 19 | ["eval_mlp", {"in_channels": 256, "dims": [9216, 1000]}], 20 | ["eval_mlp", {"in_channels": 256, "dims": [9216, 1000]}], 21 | ] 22 | -------------------------------------------------------------------------------- /configs/config/benchmark/linear_image_classification/imagenet1k/optimizers/vit_high_lr.yaml: -------------------------------------------------------------------------------- 1 | # @package _global_ 2 | config: 3 | OPTIMIZER: 4 | name: sgd 5 | # In the OSS Caffe2 benchmark, RN50 models use 1e-4 and AlexNet models 5e-4 6 | weight_decay: 0.000001 7 | momentum: 0.9 8 | num_epochs: 100 9 | nesterov: False 10 | regularize_bn: True 11 | regularize_bias: True 12 | param_schedulers: 13 | lr: 14 | auto_lr_scaling: 15 | auto_scale: true 16 | base_value: 0.3 17 | base_lr_batch_size: 256 18 | name: composite 19 | schedulers: 20 | - name: linear 21 | start_value: 0.1 22 | end_value: 0.3 23 | - name: cosine 24 | start_value: 0.3 25 | end_value: 0 26 | interval_scaling: [rescaled, rescaled] 27 | update_interval: step 28 | lengths: [0.1, .9] 29 | --------------------------------------------------------------------------------