Upload 308 files
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- FoMo4Wheat/__init__.py +6 -0
- FoMo4Wheat/__pycache__/__init__.cpython-310.pyc +0 -0
- FoMo4Wheat/__pycache__/__init__.cpython-311.pyc +0 -0
- FoMo4Wheat/__pycache__/__init__.cpython-312.pyc +0 -0
- FoMo4Wheat/__pycache__/__init__.cpython-38.pyc +0 -0
- FoMo4Wheat/__pycache__/__init__.cpython-39.pyc +0 -0
- FoMo4Wheat/configs/__init__.py +22 -0
- FoMo4Wheat/configs/__pycache__/__init__.cpython-310.pyc +0 -0
- FoMo4Wheat/configs/__pycache__/__init__.cpython-311.pyc +0 -0
- FoMo4Wheat/configs/__pycache__/__init__.cpython-39.pyc +0 -0
- FoMo4Wheat/configs/distill/vitg2vitb_14_224.yaml +132 -0
- FoMo4Wheat/configs/distill/vitg2vitb_14_518.yaml +132 -0
- FoMo4Wheat/configs/distill/vitg2vitl_14_224.yaml +132 -0
- FoMo4Wheat/configs/distill/vitg2vitl_14_518.yaml +132 -0
- FoMo4Wheat/configs/distill_default_config.yaml +132 -0
- FoMo4Wheat/configs/distill_default_config_large.yaml +132 -0
- FoMo4Wheat/configs/eval/vitb14_pretrain.yaml +6 -0
- FoMo4Wheat/configs/eval/vitb14_reg4_pretrain.yaml +9 -0
- FoMo4Wheat/configs/eval/vitg14_pretrain.yaml +7 -0
- FoMo4Wheat/configs/eval/vitg14_reg4_pretrain.yaml +10 -0
- FoMo4Wheat/configs/eval/vitl14_pretrain.yaml +6 -0
- FoMo4Wheat/configs/eval/vitl14_reg4_pretrain.yaml +9 -0
- FoMo4Wheat/configs/eval/vits14_pretrain.yaml +6 -0
- FoMo4Wheat/configs/eval/vits14_reg4_pretrain.yaml +9 -0
- FoMo4Wheat/configs/ssl_default_config.yaml +119 -0
- FoMo4Wheat/configs/train/vitg_14_224.yaml +30 -0
- FoMo4Wheat/configs/train/vitg_14_518.yaml +32 -0
- FoMo4Wheat/configs/y_distill_default_config.yaml +132 -0
- FoMo4Wheat/data/__init__.py +10 -0
- FoMo4Wheat/data/__pycache__/__init__.cpython-310.pyc +0 -0
- FoMo4Wheat/data/__pycache__/__init__.cpython-311.pyc +0 -0
- FoMo4Wheat/data/__pycache__/__init__.cpython-39.pyc +0 -0
- FoMo4Wheat/data/__pycache__/adapters.cpython-310.pyc +0 -0
- FoMo4Wheat/data/__pycache__/adapters.cpython-311.pyc +0 -0
- FoMo4Wheat/data/__pycache__/adapters.cpython-39.pyc +0 -0
- FoMo4Wheat/data/__pycache__/augmentations.cpython-310.pyc +0 -0
- FoMo4Wheat/data/__pycache__/augmentations.cpython-311.pyc +0 -0
- FoMo4Wheat/data/__pycache__/augmentations.cpython-39.pyc +0 -0
- FoMo4Wheat/data/__pycache__/collate.cpython-310.pyc +0 -0
- FoMo4Wheat/data/__pycache__/collate.cpython-311.pyc +0 -0
- FoMo4Wheat/data/__pycache__/collate.cpython-39.pyc +0 -0
- FoMo4Wheat/data/__pycache__/loaders.cpython-310.pyc +0 -0
- FoMo4Wheat/data/__pycache__/loaders.cpython-311.pyc +0 -0
- FoMo4Wheat/data/__pycache__/loaders.cpython-39.pyc +0 -0
- FoMo4Wheat/data/__pycache__/masking.cpython-310.pyc +0 -0
- FoMo4Wheat/data/__pycache__/masking.cpython-311.pyc +0 -0
- FoMo4Wheat/data/__pycache__/masking.cpython-39.pyc +0 -0
- FoMo4Wheat/data/__pycache__/samplers.cpython-310.pyc +0 -0
- FoMo4Wheat/data/__pycache__/samplers.cpython-311.pyc +0 -0
- FoMo4Wheat/data/__pycache__/samplers.cpython-39.pyc +0 -0
FoMo4Wheat/__init__.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
| 2 |
+
#
|
| 3 |
+
# This source code is licensed under the Apache License, Version 2.0
|
| 4 |
+
# found in the LICENSE file in the root directory of this source tree.
|
| 5 |
+
|
| 6 |
+
__version__ = "0.0.1"
|
FoMo4Wheat/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (183 Bytes). View file
|
|
|
FoMo4Wheat/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (200 Bytes). View file
|
|
|
FoMo4Wheat/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (194 Bytes). View file
|
|
|
FoMo4Wheat/__pycache__/__init__.cpython-38.pyc
ADDED
|
Binary file (152 Bytes). View file
|
|
|
FoMo4Wheat/__pycache__/__init__.cpython-39.pyc
ADDED
|
Binary file (181 Bytes). View file
|
|
|
FoMo4Wheat/configs/__init__.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
| 2 |
+
#
|
| 3 |
+
# This source code is licensed under the Apache License, Version 2.0
|
| 4 |
+
# found in the LICENSE file in the root directory of this source tree.
|
| 5 |
+
|
| 6 |
+
import pathlib
|
| 7 |
+
|
| 8 |
+
from omegaconf import OmegaConf
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def load_config(config_name: str):
|
| 12 |
+
config_filename = config_name + ".yaml"
|
| 13 |
+
return OmegaConf.load(pathlib.Path(__file__).parent.resolve() / config_filename)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
dinov2_default_config = load_config("ssl_default_config")
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def load_and_merge_config(config_name: str):
|
| 20 |
+
default_config = OmegaConf.create(dinov2_default_config)
|
| 21 |
+
loaded_config = load_config(config_name)
|
| 22 |
+
return OmegaConf.merge(default_config, loaded_config)
|
FoMo4Wheat/configs/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (731 Bytes). View file
|
|
|
FoMo4Wheat/configs/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (1.16 kB). View file
|
|
|
FoMo4Wheat/configs/__pycache__/__init__.cpython-39.pyc
ADDED
|
Binary file (731 Bytes). View file
|
|
|
FoMo4Wheat/configs/distill/vitg2vitb_14_224.yaml
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MODEL:
|
| 2 |
+
WEIGHTS: ''
|
| 3 |
+
compute_precision:
|
| 4 |
+
grad_scaler: true
|
| 5 |
+
teacher:
|
| 6 |
+
backbone:
|
| 7 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 8 |
+
mixed_precision:
|
| 9 |
+
param_dtype: fp16
|
| 10 |
+
reduce_dtype: fp16
|
| 11 |
+
buffer_dtype: fp32
|
| 12 |
+
dino_head:
|
| 13 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 14 |
+
mixed_precision:
|
| 15 |
+
param_dtype: fp16
|
| 16 |
+
reduce_dtype: fp16
|
| 17 |
+
buffer_dtype: fp32
|
| 18 |
+
ibot_head:
|
| 19 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 20 |
+
mixed_precision:
|
| 21 |
+
param_dtype: fp16
|
| 22 |
+
reduce_dtype: fp16
|
| 23 |
+
buffer_dtype: fp32
|
| 24 |
+
student:
|
| 25 |
+
backbone:
|
| 26 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 27 |
+
mixed_precision:
|
| 28 |
+
param_dtype: fp16
|
| 29 |
+
reduce_dtype: fp16
|
| 30 |
+
buffer_dtype: fp32
|
| 31 |
+
dino_head:
|
| 32 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 33 |
+
mixed_precision:
|
| 34 |
+
param_dtype: fp16
|
| 35 |
+
reduce_dtype: fp32
|
| 36 |
+
buffer_dtype: fp32
|
| 37 |
+
ibot_head:
|
| 38 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 39 |
+
mixed_precision:
|
| 40 |
+
param_dtype: fp16
|
| 41 |
+
reduce_dtype: fp32
|
| 42 |
+
buffer_dtype: fp32
|
| 43 |
+
dino:
|
| 44 |
+
loss_weight: 1.0
|
| 45 |
+
head_n_prototypes: 131072
|
| 46 |
+
head_bottleneck_dim: 384
|
| 47 |
+
head_nlayers: 3
|
| 48 |
+
head_hidden_dim: 2048
|
| 49 |
+
koleo_loss_weight: 0.1
|
| 50 |
+
ibot:
|
| 51 |
+
loss_weight: 1.0
|
| 52 |
+
mask_sample_probability: 0.5
|
| 53 |
+
mask_ratio_min_max:
|
| 54 |
+
- 0.1
|
| 55 |
+
- 0.5
|
| 56 |
+
separate_head: True
|
| 57 |
+
head_n_prototypes: 131072
|
| 58 |
+
head_bottleneck_dim: 256
|
| 59 |
+
head_nlayers: 3
|
| 60 |
+
head_hidden_dim: 2048
|
| 61 |
+
train:
|
| 62 |
+
batch_size_per_gpu: 64
|
| 63 |
+
dataset_path: ImageNet:split=TRAIN
|
| 64 |
+
output_dir: .
|
| 65 |
+
saveckp_freq: 20
|
| 66 |
+
seed: 0
|
| 67 |
+
num_workers: 16
|
| 68 |
+
OFFICIAL_EPOCH_LENGTH: 781
|
| 69 |
+
cache_dataset: true
|
| 70 |
+
centering: sinkhorn_knopp
|
| 71 |
+
student:
|
| 72 |
+
arch: vit_base
|
| 73 |
+
patch_size: 14
|
| 74 |
+
drop_path_rate: 0.0
|
| 75 |
+
layerscale: 1.0e-05
|
| 76 |
+
drop_path_uniform: true
|
| 77 |
+
pretrained_weights: ''
|
| 78 |
+
ffn_layer: "mlp"
|
| 79 |
+
block_chunks: 4
|
| 80 |
+
qkv_bias: true
|
| 81 |
+
proj_bias: true
|
| 82 |
+
ffn_bias: true
|
| 83 |
+
num_register_tokens: 4
|
| 84 |
+
interpolate_offset: 0.1
|
| 85 |
+
interpolate_antialias : false
|
| 86 |
+
teacher:
|
| 87 |
+
arch: vit_giant2
|
| 88 |
+
patch_size: 14
|
| 89 |
+
drop_path_rate: 0.0
|
| 90 |
+
layerscale: 1.0e-05
|
| 91 |
+
drop_path_uniform: true
|
| 92 |
+
pretrained_weights: ''
|
| 93 |
+
ffn_layer: "swiglufused"
|
| 94 |
+
block_chunks: 4
|
| 95 |
+
qkv_bias: true
|
| 96 |
+
proj_bias: true
|
| 97 |
+
ffn_bias: true
|
| 98 |
+
momentum_teacher: 0.994
|
| 99 |
+
final_momentum_teacher: 1
|
| 100 |
+
warmup_teacher_temp: 0.04
|
| 101 |
+
teacher_temp: 0.07
|
| 102 |
+
warmup_teacher_temp_epochs: 15
|
| 103 |
+
num_register_tokens: 4
|
| 104 |
+
interpolate_offset: 0.1
|
| 105 |
+
interpolate_antialias : false
|
| 106 |
+
optim:
|
| 107 |
+
epochs: 25
|
| 108 |
+
weight_decay: 0.04
|
| 109 |
+
weight_decay_end: 0.2
|
| 110 |
+
base_lr: 1e-04 # learning rate for a batch size of 1024
|
| 111 |
+
lr: 0. # will be set after applying scaling rule
|
| 112 |
+
warmup_epochs: 0
|
| 113 |
+
min_lr: 1.0e-06
|
| 114 |
+
clip_grad: 3.0
|
| 115 |
+
freeze_last_layer_epochs: 0
|
| 116 |
+
scaling_rule: sqrt_wrt_1024
|
| 117 |
+
patch_embed_lr_mult: 0.2
|
| 118 |
+
layerwise_decay: 0.9
|
| 119 |
+
adamw_beta1: 0.9
|
| 120 |
+
adamw_beta2: 0.999
|
| 121 |
+
crops:
|
| 122 |
+
global_crops_scale:
|
| 123 |
+
- 0.32
|
| 124 |
+
- 1.0
|
| 125 |
+
local_crops_number: 8
|
| 126 |
+
local_crops_scale:
|
| 127 |
+
- 0.05
|
| 128 |
+
- 0.32
|
| 129 |
+
global_crops_size: 224
|
| 130 |
+
local_crops_size: 98
|
| 131 |
+
evaluation:
|
| 132 |
+
eval_period_iterations: 2500
|
FoMo4Wheat/configs/distill/vitg2vitb_14_518.yaml
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MODEL:
|
| 2 |
+
WEIGHTS: ''
|
| 3 |
+
compute_precision:
|
| 4 |
+
grad_scaler: true
|
| 5 |
+
teacher:
|
| 6 |
+
backbone:
|
| 7 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 8 |
+
mixed_precision:
|
| 9 |
+
param_dtype: fp16
|
| 10 |
+
reduce_dtype: fp16
|
| 11 |
+
buffer_dtype: fp32
|
| 12 |
+
dino_head:
|
| 13 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 14 |
+
mixed_precision:
|
| 15 |
+
param_dtype: fp16
|
| 16 |
+
reduce_dtype: fp16
|
| 17 |
+
buffer_dtype: fp32
|
| 18 |
+
ibot_head:
|
| 19 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 20 |
+
mixed_precision:
|
| 21 |
+
param_dtype: fp16
|
| 22 |
+
reduce_dtype: fp16
|
| 23 |
+
buffer_dtype: fp32
|
| 24 |
+
student:
|
| 25 |
+
backbone:
|
| 26 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 27 |
+
mixed_precision:
|
| 28 |
+
param_dtype: bf16
|
| 29 |
+
reduce_dtype: bf16
|
| 30 |
+
buffer_dtype: fp32
|
| 31 |
+
dino_head:
|
| 32 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 33 |
+
mixed_precision:
|
| 34 |
+
param_dtype: bf16
|
| 35 |
+
reduce_dtype: fp32
|
| 36 |
+
buffer_dtype: fp32
|
| 37 |
+
ibot_head:
|
| 38 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 39 |
+
mixed_precision:
|
| 40 |
+
param_dtype: bf16
|
| 41 |
+
reduce_dtype: fp32
|
| 42 |
+
buffer_dtype: fp32
|
| 43 |
+
dino:
|
| 44 |
+
loss_weight: 1.0
|
| 45 |
+
head_n_prototypes: 131072
|
| 46 |
+
head_bottleneck_dim: 384
|
| 47 |
+
head_nlayers: 3
|
| 48 |
+
head_hidden_dim: 2048
|
| 49 |
+
koleo_loss_weight: 0.1
|
| 50 |
+
ibot:
|
| 51 |
+
loss_weight: 1.0
|
| 52 |
+
mask_sample_probability: 0.5
|
| 53 |
+
mask_ratio_min_max:
|
| 54 |
+
- 0.1
|
| 55 |
+
- 0.5
|
| 56 |
+
separate_head: True
|
| 57 |
+
head_n_prototypes: 131072
|
| 58 |
+
head_bottleneck_dim: 256
|
| 59 |
+
head_nlayers: 3
|
| 60 |
+
head_hidden_dim: 2048
|
| 61 |
+
train:
|
| 62 |
+
batch_size_per_gpu: 16
|
| 63 |
+
dataset_path: ImageNet:split=TRAIN
|
| 64 |
+
output_dir: .
|
| 65 |
+
saveckp_freq: 20
|
| 66 |
+
seed: 0
|
| 67 |
+
num_workers: 16
|
| 68 |
+
OFFICIAL_EPOCH_LENGTH: 1250
|
| 69 |
+
cache_dataset: true
|
| 70 |
+
centering: sinkhorn_knopp
|
| 71 |
+
student:
|
| 72 |
+
arch: vit_base
|
| 73 |
+
patch_size: 14
|
| 74 |
+
drop_path_rate: 0.0
|
| 75 |
+
layerscale: 1.0e-05
|
| 76 |
+
drop_path_uniform: true
|
| 77 |
+
pretrained_weights: ''
|
| 78 |
+
ffn_layer: "mlp"
|
| 79 |
+
block_chunks: 4
|
| 80 |
+
qkv_bias: true
|
| 81 |
+
proj_bias: true
|
| 82 |
+
ffn_bias: true
|
| 83 |
+
num_register_tokens: 4
|
| 84 |
+
interpolate_offset: 0.1
|
| 85 |
+
interpolate_antialias : false
|
| 86 |
+
teacher:
|
| 87 |
+
arch: vit_giant2
|
| 88 |
+
patch_size: 14
|
| 89 |
+
drop_path_rate: 0.4
|
| 90 |
+
layerscale: 1.0e-05
|
| 91 |
+
drop_path_uniform: true
|
| 92 |
+
pretrained_weights: ''
|
| 93 |
+
ffn_layer: "swiglufused"
|
| 94 |
+
block_chunks: 4
|
| 95 |
+
qkv_bias: true
|
| 96 |
+
proj_bias: true
|
| 97 |
+
ffn_bias: true
|
| 98 |
+
momentum_teacher: 0.994
|
| 99 |
+
final_momentum_teacher: 1
|
| 100 |
+
warmup_teacher_temp: 0.04
|
| 101 |
+
teacher_temp: 0.07
|
| 102 |
+
warmup_teacher_temp_epochs: 30
|
| 103 |
+
num_register_tokens: 4
|
| 104 |
+
interpolate_offset: 0.1
|
| 105 |
+
interpolate_antialias : false
|
| 106 |
+
optim:
|
| 107 |
+
epochs: 100
|
| 108 |
+
weight_decay: 0.04
|
| 109 |
+
weight_decay_end: 0.2
|
| 110 |
+
base_lr: 5e-05 # learning rate for a batch size of 1024
|
| 111 |
+
lr: 0. # will be set after applying scaling rule
|
| 112 |
+
warmup_epochs: 10
|
| 113 |
+
min_lr: 1.0e-06
|
| 114 |
+
clip_grad: 3.0
|
| 115 |
+
freeze_last_layer_epochs: 0
|
| 116 |
+
scaling_rule: sqrt_wrt_1024
|
| 117 |
+
patch_embed_lr_mult: 0.2
|
| 118 |
+
layerwise_decay: 0.9
|
| 119 |
+
adamw_beta1: 0.9
|
| 120 |
+
adamw_beta2: 0.999
|
| 121 |
+
crops:
|
| 122 |
+
global_crops_scale:
|
| 123 |
+
- 0.32
|
| 124 |
+
- 1.0
|
| 125 |
+
local_crops_number: 8
|
| 126 |
+
local_crops_scale:
|
| 127 |
+
- 0.05
|
| 128 |
+
- 0.32
|
| 129 |
+
global_crops_size: 518
|
| 130 |
+
local_crops_size: 98
|
| 131 |
+
evaluation:
|
| 132 |
+
eval_period_iterations: 1250
|
FoMo4Wheat/configs/distill/vitg2vitl_14_224.yaml
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MODEL:
|
| 2 |
+
WEIGHTS: ''
|
| 3 |
+
compute_precision:
|
| 4 |
+
grad_scaler: true
|
| 5 |
+
teacher:
|
| 6 |
+
backbone:
|
| 7 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 8 |
+
mixed_precision:
|
| 9 |
+
param_dtype: fp16
|
| 10 |
+
reduce_dtype: fp16
|
| 11 |
+
buffer_dtype: fp32
|
| 12 |
+
dino_head:
|
| 13 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 14 |
+
mixed_precision:
|
| 15 |
+
param_dtype: fp16
|
| 16 |
+
reduce_dtype: fp16
|
| 17 |
+
buffer_dtype: fp32
|
| 18 |
+
ibot_head:
|
| 19 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 20 |
+
mixed_precision:
|
| 21 |
+
param_dtype: fp16
|
| 22 |
+
reduce_dtype: fp16
|
| 23 |
+
buffer_dtype: fp32
|
| 24 |
+
student:
|
| 25 |
+
backbone:
|
| 26 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 27 |
+
mixed_precision:
|
| 28 |
+
param_dtype: fp16
|
| 29 |
+
reduce_dtype: fp16
|
| 30 |
+
buffer_dtype: fp32
|
| 31 |
+
dino_head:
|
| 32 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 33 |
+
mixed_precision:
|
| 34 |
+
param_dtype: fp16
|
| 35 |
+
reduce_dtype: fp32
|
| 36 |
+
buffer_dtype: fp32
|
| 37 |
+
ibot_head:
|
| 38 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 39 |
+
mixed_precision:
|
| 40 |
+
param_dtype: fp16
|
| 41 |
+
reduce_dtype: fp32
|
| 42 |
+
buffer_dtype: fp32
|
| 43 |
+
dino:
|
| 44 |
+
loss_weight: 1.0
|
| 45 |
+
head_n_prototypes: 131072
|
| 46 |
+
head_bottleneck_dim: 384
|
| 47 |
+
head_nlayers: 3
|
| 48 |
+
head_hidden_dim: 2048
|
| 49 |
+
koleo_loss_weight: 0.1
|
| 50 |
+
ibot:
|
| 51 |
+
loss_weight: 1.0
|
| 52 |
+
mask_sample_probability: 0.5
|
| 53 |
+
mask_ratio_min_max:
|
| 54 |
+
- 0.1
|
| 55 |
+
- 0.5
|
| 56 |
+
separate_head: True
|
| 57 |
+
head_n_prototypes: 131072
|
| 58 |
+
head_bottleneck_dim: 256
|
| 59 |
+
head_nlayers: 3
|
| 60 |
+
head_hidden_dim: 2048
|
| 61 |
+
train:
|
| 62 |
+
batch_size_per_gpu: 64
|
| 63 |
+
dataset_path: ImageNet:split=TRAIN
|
| 64 |
+
output_dir: .
|
| 65 |
+
saveckp_freq: 20
|
| 66 |
+
seed: 0
|
| 67 |
+
num_workers: 16
|
| 68 |
+
OFFICIAL_EPOCH_LENGTH: 781
|
| 69 |
+
cache_dataset: true
|
| 70 |
+
centering: sinkhorn_knopp
|
| 71 |
+
student:
|
| 72 |
+
arch: vit_large
|
| 73 |
+
patch_size: 14
|
| 74 |
+
drop_path_rate: 0.0
|
| 75 |
+
layerscale: 1.0e-05
|
| 76 |
+
drop_path_uniform: true
|
| 77 |
+
pretrained_weights: 'dinov2_vitl14_reg4_pretrain.pth'
|
| 78 |
+
ffn_layer: "mlp"
|
| 79 |
+
block_chunks: 4
|
| 80 |
+
qkv_bias: true
|
| 81 |
+
proj_bias: true
|
| 82 |
+
ffn_bias: true
|
| 83 |
+
num_register_tokens: 4
|
| 84 |
+
interpolate_offset: 0.1
|
| 85 |
+
interpolate_antialias : false
|
| 86 |
+
teacher:
|
| 87 |
+
arch: vit_giant2
|
| 88 |
+
patch_size: 14
|
| 89 |
+
drop_path_rate: 0.0
|
| 90 |
+
layerscale: 1.0e-05
|
| 91 |
+
drop_path_uniform: true
|
| 92 |
+
pretrained_weights: ''
|
| 93 |
+
ffn_layer: "swiglufused"
|
| 94 |
+
block_chunks: 4
|
| 95 |
+
qkv_bias: true
|
| 96 |
+
proj_bias: true
|
| 97 |
+
ffn_bias: true
|
| 98 |
+
momentum_teacher: 0.994
|
| 99 |
+
final_momentum_teacher: 1
|
| 100 |
+
warmup_teacher_temp: 0.04
|
| 101 |
+
teacher_temp: 0.07
|
| 102 |
+
warmup_teacher_temp_epochs: 15
|
| 103 |
+
num_register_tokens: 4
|
| 104 |
+
interpolate_offset: 0.1
|
| 105 |
+
interpolate_antialias : false
|
| 106 |
+
optim:
|
| 107 |
+
epochs: 25
|
| 108 |
+
weight_decay: 0.04
|
| 109 |
+
weight_decay_end: 0.2
|
| 110 |
+
base_lr: 1e-04 # learning rate for a batch size of 1024
|
| 111 |
+
lr: 0. # will be set after applying scaling rule
|
| 112 |
+
warmup_epochs: 0
|
| 113 |
+
min_lr: 1.0e-06
|
| 114 |
+
clip_grad: 3.0
|
| 115 |
+
freeze_last_layer_epochs: 0
|
| 116 |
+
scaling_rule: sqrt_wrt_1024
|
| 117 |
+
patch_embed_lr_mult: 0.2
|
| 118 |
+
layerwise_decay: 0.9
|
| 119 |
+
adamw_beta1: 0.9
|
| 120 |
+
adamw_beta2: 0.999
|
| 121 |
+
crops:
|
| 122 |
+
global_crops_scale:
|
| 123 |
+
- 0.32
|
| 124 |
+
- 1.0
|
| 125 |
+
local_crops_number: 8
|
| 126 |
+
local_crops_scale:
|
| 127 |
+
- 0.05
|
| 128 |
+
- 0.32
|
| 129 |
+
global_crops_size: 224
|
| 130 |
+
local_crops_size: 98
|
| 131 |
+
evaluation:
|
| 132 |
+
eval_period_iterations: 2500
|
FoMo4Wheat/configs/distill/vitg2vitl_14_518.yaml
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MODEL:
|
| 2 |
+
WEIGHTS: ''
|
| 3 |
+
compute_precision:
|
| 4 |
+
grad_scaler: true
|
| 5 |
+
teacher:
|
| 6 |
+
backbone:
|
| 7 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 8 |
+
mixed_precision:
|
| 9 |
+
param_dtype: fp16
|
| 10 |
+
reduce_dtype: fp16
|
| 11 |
+
buffer_dtype: fp32
|
| 12 |
+
dino_head:
|
| 13 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 14 |
+
mixed_precision:
|
| 15 |
+
param_dtype: fp16
|
| 16 |
+
reduce_dtype: fp16
|
| 17 |
+
buffer_dtype: fp32
|
| 18 |
+
ibot_head:
|
| 19 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 20 |
+
mixed_precision:
|
| 21 |
+
param_dtype: fp16
|
| 22 |
+
reduce_dtype: fp16
|
| 23 |
+
buffer_dtype: fp32
|
| 24 |
+
student:
|
| 25 |
+
backbone:
|
| 26 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 27 |
+
mixed_precision:
|
| 28 |
+
param_dtype: bf16
|
| 29 |
+
reduce_dtype: bf16
|
| 30 |
+
buffer_dtype: fp32
|
| 31 |
+
dino_head:
|
| 32 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 33 |
+
mixed_precision:
|
| 34 |
+
param_dtype: bf16
|
| 35 |
+
reduce_dtype: fp32
|
| 36 |
+
buffer_dtype: fp32
|
| 37 |
+
ibot_head:
|
| 38 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 39 |
+
mixed_precision:
|
| 40 |
+
param_dtype: bf16
|
| 41 |
+
reduce_dtype: fp32
|
| 42 |
+
buffer_dtype: fp32
|
| 43 |
+
dino:
|
| 44 |
+
loss_weight: 1.0
|
| 45 |
+
head_n_prototypes: 131072
|
| 46 |
+
head_bottleneck_dim: 384
|
| 47 |
+
head_nlayers: 3
|
| 48 |
+
head_hidden_dim: 2048
|
| 49 |
+
koleo_loss_weight: 0.1
|
| 50 |
+
ibot:
|
| 51 |
+
loss_weight: 1.0
|
| 52 |
+
mask_sample_probability: 0.5
|
| 53 |
+
mask_ratio_min_max:
|
| 54 |
+
- 0.1
|
| 55 |
+
- 0.5
|
| 56 |
+
separate_head: True
|
| 57 |
+
head_n_prototypes: 131072
|
| 58 |
+
head_bottleneck_dim: 256
|
| 59 |
+
head_nlayers: 3
|
| 60 |
+
head_hidden_dim: 2048
|
| 61 |
+
train:
|
| 62 |
+
batch_size_per_gpu: 16
|
| 63 |
+
dataset_path: ImageNet:split=TRAIN
|
| 64 |
+
output_dir: .
|
| 65 |
+
saveckp_freq: 20
|
| 66 |
+
seed: 0
|
| 67 |
+
num_workers: 16
|
| 68 |
+
OFFICIAL_EPOCH_LENGTH: 1250
|
| 69 |
+
cache_dataset: true
|
| 70 |
+
centering: sinkhorn_knopp
|
| 71 |
+
student:
|
| 72 |
+
arch: vit_large
|
| 73 |
+
patch_size: 14
|
| 74 |
+
drop_path_rate: 0.0
|
| 75 |
+
layerscale: 1.0e-05
|
| 76 |
+
drop_path_uniform: true
|
| 77 |
+
pretrained_weights: ''
|
| 78 |
+
ffn_layer: "mlp"
|
| 79 |
+
block_chunks: 4
|
| 80 |
+
qkv_bias: true
|
| 81 |
+
proj_bias: true
|
| 82 |
+
ffn_bias: true
|
| 83 |
+
num_register_tokens: 4
|
| 84 |
+
interpolate_offset: 0.1
|
| 85 |
+
interpolate_antialias : false
|
| 86 |
+
teacher:
|
| 87 |
+
arch: vit_giant2
|
| 88 |
+
patch_size: 14
|
| 89 |
+
drop_path_rate: 0.4
|
| 90 |
+
layerscale: 1.0e-05
|
| 91 |
+
drop_path_uniform: true
|
| 92 |
+
pretrained_weights: ''
|
| 93 |
+
ffn_layer: "swiglufused"
|
| 94 |
+
block_chunks: 4
|
| 95 |
+
qkv_bias: true
|
| 96 |
+
proj_bias: true
|
| 97 |
+
ffn_bias: true
|
| 98 |
+
momentum_teacher: 0.994
|
| 99 |
+
final_momentum_teacher: 1
|
| 100 |
+
warmup_teacher_temp: 0.04
|
| 101 |
+
teacher_temp: 0.07
|
| 102 |
+
warmup_teacher_temp_epochs: 30
|
| 103 |
+
num_register_tokens: 4
|
| 104 |
+
interpolate_offset: 0.1
|
| 105 |
+
interpolate_antialias : false
|
| 106 |
+
optim:
|
| 107 |
+
epochs: 100
|
| 108 |
+
weight_decay: 0.04
|
| 109 |
+
weight_decay_end: 0.2
|
| 110 |
+
base_lr: 5e-05 # learning rate for a batch size of 1024
|
| 111 |
+
lr: 0. # will be set after applying scaling rule
|
| 112 |
+
warmup_epochs: 10
|
| 113 |
+
min_lr: 1.0e-06
|
| 114 |
+
clip_grad: 3.0
|
| 115 |
+
freeze_last_layer_epochs: 0
|
| 116 |
+
scaling_rule: sqrt_wrt_1024
|
| 117 |
+
patch_embed_lr_mult: 0.2
|
| 118 |
+
layerwise_decay: 0.9
|
| 119 |
+
adamw_beta1: 0.9
|
| 120 |
+
adamw_beta2: 0.999
|
| 121 |
+
crops:
|
| 122 |
+
global_crops_scale:
|
| 123 |
+
- 0.32
|
| 124 |
+
- 1.0
|
| 125 |
+
local_crops_number: 8
|
| 126 |
+
local_crops_scale:
|
| 127 |
+
- 0.05
|
| 128 |
+
- 0.32
|
| 129 |
+
global_crops_size: 518
|
| 130 |
+
local_crops_size: 98
|
| 131 |
+
evaluation:
|
| 132 |
+
eval_period_iterations: 1250
|
FoMo4Wheat/configs/distill_default_config.yaml
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MODEL:
|
| 2 |
+
WEIGHTS: ''
|
| 3 |
+
compute_precision:
|
| 4 |
+
grad_scaler: true
|
| 5 |
+
teacher:
|
| 6 |
+
backbone:
|
| 7 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 8 |
+
mixed_precision:
|
| 9 |
+
param_dtype: fp16
|
| 10 |
+
reduce_dtype: fp16
|
| 11 |
+
buffer_dtype: fp32
|
| 12 |
+
dino_head:
|
| 13 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 14 |
+
mixed_precision:
|
| 15 |
+
param_dtype: fp16
|
| 16 |
+
reduce_dtype: fp16
|
| 17 |
+
buffer_dtype: fp32
|
| 18 |
+
ibot_head:
|
| 19 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 20 |
+
mixed_precision:
|
| 21 |
+
param_dtype: fp16
|
| 22 |
+
reduce_dtype: fp16
|
| 23 |
+
buffer_dtype: fp32
|
| 24 |
+
student:
|
| 25 |
+
backbone:
|
| 26 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 27 |
+
mixed_precision:
|
| 28 |
+
param_dtype: bf16
|
| 29 |
+
reduce_dtype: bf16
|
| 30 |
+
buffer_dtype: fp32
|
| 31 |
+
dino_head:
|
| 32 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 33 |
+
mixed_precision:
|
| 34 |
+
param_dtype: bf16
|
| 35 |
+
reduce_dtype: fp32
|
| 36 |
+
buffer_dtype: fp32
|
| 37 |
+
ibot_head:
|
| 38 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 39 |
+
mixed_precision:
|
| 40 |
+
param_dtype: bf16
|
| 41 |
+
reduce_dtype: fp32
|
| 42 |
+
buffer_dtype: fp32
|
| 43 |
+
dino:
|
| 44 |
+
loss_weight: 1.0
|
| 45 |
+
head_n_prototypes: 131072
|
| 46 |
+
head_bottleneck_dim: 384
|
| 47 |
+
head_nlayers: 3
|
| 48 |
+
head_hidden_dim: 2048
|
| 49 |
+
koleo_loss_weight: -1
|
| 50 |
+
ibot:
|
| 51 |
+
loss_weight: 1.0
|
| 52 |
+
mask_sample_probability: 0.5
|
| 53 |
+
mask_ratio_min_max:
|
| 54 |
+
- 0.1
|
| 55 |
+
- 0.5
|
| 56 |
+
separate_head: True
|
| 57 |
+
head_n_prototypes: 131072
|
| 58 |
+
head_bottleneck_dim: 256
|
| 59 |
+
head_nlayers: 3
|
| 60 |
+
head_hidden_dim: 2048
|
| 61 |
+
train:
|
| 62 |
+
batch_size_per_gpu: 16
|
| 63 |
+
dataset_path: ImageNet:split=TRAIN
|
| 64 |
+
output_dir: .
|
| 65 |
+
saveckp_freq: 20
|
| 66 |
+
seed: 0
|
| 67 |
+
num_workers: 16
|
| 68 |
+
OFFICIAL_EPOCH_LENGTH: 1250
|
| 69 |
+
cache_dataset: true
|
| 70 |
+
centering: sinkhorn_knopp
|
| 71 |
+
student:
|
| 72 |
+
arch: vit_base
|
| 73 |
+
patch_size: 14
|
| 74 |
+
drop_path_rate: 0.0
|
| 75 |
+
layerscale: 1.0e-05
|
| 76 |
+
drop_path_uniform: true
|
| 77 |
+
pretrained_weights: ''
|
| 78 |
+
ffn_layer: "mlp"
|
| 79 |
+
block_chunks: 4
|
| 80 |
+
qkv_bias: true
|
| 81 |
+
proj_bias: true
|
| 82 |
+
ffn_bias: true
|
| 83 |
+
num_register_tokens: 4
|
| 84 |
+
interpolate_offset: 0.1
|
| 85 |
+
interpolate_antialias : false
|
| 86 |
+
teacher:
|
| 87 |
+
arch: vit_giant2
|
| 88 |
+
patch_size: 14
|
| 89 |
+
drop_path_rate: 0.4
|
| 90 |
+
layerscale: 1.0e-05
|
| 91 |
+
drop_path_uniform: true
|
| 92 |
+
pretrained_weights: '/hpc/home/2023222003/Phenix/wheat/foundation_model/distill_pretrain/518_vitg/teacher_checkpoint.pth'
|
| 93 |
+
ffn_layer: "swiglufused"
|
| 94 |
+
block_chunks: 4
|
| 95 |
+
qkv_bias: true
|
| 96 |
+
proj_bias: true
|
| 97 |
+
ffn_bias: true
|
| 98 |
+
momentum_teacher: 0.994
|
| 99 |
+
final_momentum_teacher: 1
|
| 100 |
+
warmup_teacher_temp: 0.04
|
| 101 |
+
teacher_temp: 0.07
|
| 102 |
+
warmup_teacher_temp_epochs: 30
|
| 103 |
+
num_register_tokens: 4
|
| 104 |
+
interpolate_offset: 0.1
|
| 105 |
+
interpolate_antialias : false
|
| 106 |
+
optim:
|
| 107 |
+
epochs: 100
|
| 108 |
+
weight_decay: 0.04
|
| 109 |
+
weight_decay_end: 0.2
|
| 110 |
+
base_lr: 1e-04 # learning rate for a batch size of 1024
|
| 111 |
+
lr: 0. # will be set after applying scaling rule
|
| 112 |
+
warmup_epochs: 10
|
| 113 |
+
min_lr: 1.0e-06
|
| 114 |
+
clip_grad: 3.0
|
| 115 |
+
freeze_last_layer_epochs: 0
|
| 116 |
+
scaling_rule: sqrt_wrt_1024
|
| 117 |
+
patch_embed_lr_mult: 0.2
|
| 118 |
+
layerwise_decay: 1
|
| 119 |
+
adamw_beta1: 0.9
|
| 120 |
+
adamw_beta2: 0.999
|
| 121 |
+
crops:
|
| 122 |
+
global_crops_scale:
|
| 123 |
+
- 0.32
|
| 124 |
+
- 1.0
|
| 125 |
+
local_crops_number: 8
|
| 126 |
+
local_crops_scale:
|
| 127 |
+
- 0.05
|
| 128 |
+
- 0.32
|
| 129 |
+
global_crops_size: 518
|
| 130 |
+
local_crops_size: 98
|
| 131 |
+
evaluation:
|
| 132 |
+
eval_period_iterations: 2500
|
FoMo4Wheat/configs/distill_default_config_large.yaml
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MODEL:
|
| 2 |
+
WEIGHTS: ''
|
| 3 |
+
compute_precision:
|
| 4 |
+
grad_scaler: true
|
| 5 |
+
teacher:
|
| 6 |
+
backbone:
|
| 7 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 8 |
+
mixed_precision:
|
| 9 |
+
param_dtype: fp16
|
| 10 |
+
reduce_dtype: fp16
|
| 11 |
+
buffer_dtype: fp32
|
| 12 |
+
dino_head:
|
| 13 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 14 |
+
mixed_precision:
|
| 15 |
+
param_dtype: fp16
|
| 16 |
+
reduce_dtype: fp16
|
| 17 |
+
buffer_dtype: fp32
|
| 18 |
+
ibot_head:
|
| 19 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 20 |
+
mixed_precision:
|
| 21 |
+
param_dtype: fp16
|
| 22 |
+
reduce_dtype: fp16
|
| 23 |
+
buffer_dtype: fp32
|
| 24 |
+
student:
|
| 25 |
+
backbone:
|
| 26 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 27 |
+
mixed_precision:
|
| 28 |
+
param_dtype: bf16
|
| 29 |
+
reduce_dtype: bf16
|
| 30 |
+
buffer_dtype: fp32
|
| 31 |
+
dino_head:
|
| 32 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 33 |
+
mixed_precision:
|
| 34 |
+
param_dtype: bf16
|
| 35 |
+
reduce_dtype: fp32
|
| 36 |
+
buffer_dtype: fp32
|
| 37 |
+
ibot_head:
|
| 38 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 39 |
+
mixed_precision:
|
| 40 |
+
param_dtype: bf16
|
| 41 |
+
reduce_dtype: fp32
|
| 42 |
+
buffer_dtype: fp32
|
| 43 |
+
dino:
|
| 44 |
+
loss_weight: 1.0
|
| 45 |
+
head_n_prototypes: 131072
|
| 46 |
+
head_bottleneck_dim: 384
|
| 47 |
+
head_nlayers: 3
|
| 48 |
+
head_hidden_dim: 2048
|
| 49 |
+
koleo_loss_weight: -1
|
| 50 |
+
ibot:
|
| 51 |
+
loss_weight: 1.0
|
| 52 |
+
mask_sample_probability: 0.5
|
| 53 |
+
mask_ratio_min_max:
|
| 54 |
+
- 0.1
|
| 55 |
+
- 0.5
|
| 56 |
+
separate_head: True
|
| 57 |
+
head_n_prototypes: 131072
|
| 58 |
+
head_bottleneck_dim: 256
|
| 59 |
+
head_nlayers: 3
|
| 60 |
+
head_hidden_dim: 2048
|
| 61 |
+
train:
|
| 62 |
+
batch_size_per_gpu: 16
|
| 63 |
+
dataset_path: ImageNet:split=TRAIN
|
| 64 |
+
output_dir: .
|
| 65 |
+
saveckp_freq: 20
|
| 66 |
+
seed: 0
|
| 67 |
+
num_workers: 16
|
| 68 |
+
OFFICIAL_EPOCH_LENGTH: 1250
|
| 69 |
+
cache_dataset: true
|
| 70 |
+
centering: sinkhorn_knopp
|
| 71 |
+
student:
|
| 72 |
+
arch: vit_large
|
| 73 |
+
patch_size: 14
|
| 74 |
+
drop_path_rate: 0.0
|
| 75 |
+
layerscale: 1.0e-05
|
| 76 |
+
drop_path_uniform: true
|
| 77 |
+
pretrained_weights: ''
|
| 78 |
+
ffn_layer: "mlp"
|
| 79 |
+
block_chunks: 4
|
| 80 |
+
qkv_bias: true
|
| 81 |
+
proj_bias: true
|
| 82 |
+
ffn_bias: true
|
| 83 |
+
num_register_tokens: 4
|
| 84 |
+
interpolate_offset: 0.1
|
| 85 |
+
interpolate_antialias : false
|
| 86 |
+
teacher:
|
| 87 |
+
arch: vit_giant2
|
| 88 |
+
patch_size: 14
|
| 89 |
+
drop_path_rate: 0.4
|
| 90 |
+
layerscale: 1.0e-05
|
| 91 |
+
drop_path_uniform: true
|
| 92 |
+
pretrained_weights: '/hpc/home/2023222003/Phenix/wheat/foundation_model/distill_pretrain/518_vitg/teacher_checkpoint.pth'
|
| 93 |
+
ffn_layer: "swiglufused"
|
| 94 |
+
block_chunks: 4
|
| 95 |
+
qkv_bias: true
|
| 96 |
+
proj_bias: true
|
| 97 |
+
ffn_bias: true
|
| 98 |
+
momentum_teacher: 0.994
|
| 99 |
+
final_momentum_teacher: 1
|
| 100 |
+
warmup_teacher_temp: 0.04
|
| 101 |
+
teacher_temp: 0.07
|
| 102 |
+
warmup_teacher_temp_epochs: 30
|
| 103 |
+
num_register_tokens: 4
|
| 104 |
+
interpolate_offset: 0.1
|
| 105 |
+
interpolate_antialias : false
|
| 106 |
+
optim:
|
| 107 |
+
epochs: 100
|
| 108 |
+
weight_decay: 0.04
|
| 109 |
+
weight_decay_end: 0.2
|
| 110 |
+
base_lr: 1e-04 # learning rate for a batch size of 1024
|
| 111 |
+
lr: 0. # will be set after applying scaling rule
|
| 112 |
+
warmup_epochs: 10
|
| 113 |
+
min_lr: 1.0e-06
|
| 114 |
+
clip_grad: 3.0
|
| 115 |
+
freeze_last_layer_epochs: 0
|
| 116 |
+
scaling_rule: sqrt_wrt_1024
|
| 117 |
+
patch_embed_lr_mult: 0.2
|
| 118 |
+
layerwise_decay: 1
|
| 119 |
+
adamw_beta1: 0.9
|
| 120 |
+
adamw_beta2: 0.999
|
| 121 |
+
crops:
|
| 122 |
+
global_crops_scale:
|
| 123 |
+
- 0.32
|
| 124 |
+
- 1.0
|
| 125 |
+
local_crops_number: 8
|
| 126 |
+
local_crops_scale:
|
| 127 |
+
- 0.05
|
| 128 |
+
- 0.32
|
| 129 |
+
global_crops_size: 518
|
| 130 |
+
local_crops_size: 98
|
| 131 |
+
evaluation:
|
| 132 |
+
eval_period_iterations: 2500
|
FoMo4Wheat/configs/eval/vitb14_pretrain.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
student:
|
| 2 |
+
arch: vit_base
|
| 3 |
+
patch_size: 14
|
| 4 |
+
crops:
|
| 5 |
+
global_crops_size: 518 # this is to set up the position embeddings properly
|
| 6 |
+
local_crops_size: 98
|
FoMo4Wheat/configs/eval/vitb14_reg4_pretrain.yaml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
student:
|
| 2 |
+
arch: vit_base
|
| 3 |
+
patch_size: 14
|
| 4 |
+
num_register_tokens: 4
|
| 5 |
+
interpolate_antialias: true
|
| 6 |
+
interpolate_offset: 0.0
|
| 7 |
+
crops:
|
| 8 |
+
global_crops_size: 518 # this is to set up the position embeddings properly
|
| 9 |
+
local_crops_size: 98
|
FoMo4Wheat/configs/eval/vitg14_pretrain.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
student:
|
| 2 |
+
arch: vit_giant2
|
| 3 |
+
patch_size: 14
|
| 4 |
+
ffn_layer: swiglufused
|
| 5 |
+
crops:
|
| 6 |
+
global_crops_size: 518 # this is to set up the position embeddings properly
|
| 7 |
+
local_crops_size: 98
|
FoMo4Wheat/configs/eval/vitg14_reg4_pretrain.yaml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
student:
|
| 2 |
+
arch: vit_giant2
|
| 3 |
+
patch_size: 14
|
| 4 |
+
ffn_layer: swiglufused
|
| 5 |
+
num_register_tokens: 4
|
| 6 |
+
interpolate_antialias: true
|
| 7 |
+
interpolate_offset: 0.0
|
| 8 |
+
crops:
|
| 9 |
+
global_crops_size: 518 # this is to set up the position embeddings properly
|
| 10 |
+
local_crops_size: 98
|
FoMo4Wheat/configs/eval/vitl14_pretrain.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
student:
|
| 2 |
+
arch: vit_large
|
| 3 |
+
patch_size: 14
|
| 4 |
+
crops:
|
| 5 |
+
global_crops_size: 518 # this is to set up the position embeddings properly
|
| 6 |
+
local_crops_size: 98
|
FoMo4Wheat/configs/eval/vitl14_reg4_pretrain.yaml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
student:
|
| 2 |
+
arch: vit_large
|
| 3 |
+
patch_size: 14
|
| 4 |
+
num_register_tokens: 4
|
| 5 |
+
interpolate_antialias: true
|
| 6 |
+
interpolate_offset: 0.0
|
| 7 |
+
crops:
|
| 8 |
+
global_crops_size: 518 # this is to set up the position embeddings properly
|
| 9 |
+
local_crops_size: 98
|
FoMo4Wheat/configs/eval/vits14_pretrain.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
student:
|
| 2 |
+
arch: vit_small
|
| 3 |
+
patch_size: 14
|
| 4 |
+
crops:
|
| 5 |
+
global_crops_size: 518 # this is to set up the position embeddings properly
|
| 6 |
+
local_crops_size: 98
|
FoMo4Wheat/configs/eval/vits14_reg4_pretrain.yaml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
student:
|
| 2 |
+
arch: vit_small
|
| 3 |
+
patch_size: 14
|
| 4 |
+
num_register_tokens: 4
|
| 5 |
+
interpolate_antialias: true
|
| 6 |
+
interpolate_offset: 0.0
|
| 7 |
+
crops:
|
| 8 |
+
global_crops_size: 518 # this is to set up the position embeddings properly
|
| 9 |
+
local_crops_size: 98
|
FoMo4Wheat/configs/ssl_default_config.yaml
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MODEL:
|
| 2 |
+
WEIGHTS: ''
|
| 3 |
+
compute_precision:
|
| 4 |
+
grad_scaler: true
|
| 5 |
+
teacher:
|
| 6 |
+
backbone:
|
| 7 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 8 |
+
mixed_precision:
|
| 9 |
+
param_dtype: fp16
|
| 10 |
+
reduce_dtype: fp16
|
| 11 |
+
buffer_dtype: fp32
|
| 12 |
+
dino_head:
|
| 13 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 14 |
+
mixed_precision:
|
| 15 |
+
param_dtype: fp16
|
| 16 |
+
reduce_dtype: fp16
|
| 17 |
+
buffer_dtype: fp32
|
| 18 |
+
ibot_head:
|
| 19 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 20 |
+
mixed_precision:
|
| 21 |
+
param_dtype: fp16
|
| 22 |
+
reduce_dtype: fp16
|
| 23 |
+
buffer_dtype: fp32
|
| 24 |
+
student:
|
| 25 |
+
backbone:
|
| 26 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 27 |
+
mixed_precision:
|
| 28 |
+
param_dtype: fp16
|
| 29 |
+
reduce_dtype: fp16
|
| 30 |
+
buffer_dtype: fp32
|
| 31 |
+
dino_head:
|
| 32 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 33 |
+
mixed_precision:
|
| 34 |
+
param_dtype: fp16
|
| 35 |
+
reduce_dtype: fp32
|
| 36 |
+
buffer_dtype: fp32
|
| 37 |
+
ibot_head:
|
| 38 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 39 |
+
mixed_precision:
|
| 40 |
+
param_dtype: fp16
|
| 41 |
+
reduce_dtype: fp32
|
| 42 |
+
buffer_dtype: fp32
|
| 43 |
+
dino:
|
| 44 |
+
loss_weight: 1.0
|
| 45 |
+
head_n_prototypes: 65536
|
| 46 |
+
head_bottleneck_dim: 256
|
| 47 |
+
head_nlayers: 3
|
| 48 |
+
head_hidden_dim: 2048
|
| 49 |
+
koleo_loss_weight: 0.1
|
| 50 |
+
ibot:
|
| 51 |
+
loss_weight: 1.0
|
| 52 |
+
mask_sample_probability: 0.5
|
| 53 |
+
mask_ratio_min_max:
|
| 54 |
+
- 0.1
|
| 55 |
+
- 0.5
|
| 56 |
+
separate_head: false
|
| 57 |
+
head_n_prototypes: 65536
|
| 58 |
+
head_bottleneck_dim: 256
|
| 59 |
+
head_nlayers: 3
|
| 60 |
+
head_hidden_dim: 2048
|
| 61 |
+
train:
|
| 62 |
+
batch_size_per_gpu: 64
|
| 63 |
+
dataset_path: ImageNet:split=TRAIN
|
| 64 |
+
output_dir: .
|
| 65 |
+
saveckp_freq: 20
|
| 66 |
+
seed: 0
|
| 67 |
+
num_workers: 6
|
| 68 |
+
OFFICIAL_EPOCH_LENGTH: 1250
|
| 69 |
+
cache_dataset: true
|
| 70 |
+
centering: "centering" # or "sinkhorn_knopp"
|
| 71 |
+
student:
|
| 72 |
+
arch: vit_large
|
| 73 |
+
patch_size: 16
|
| 74 |
+
drop_path_rate: 0.3
|
| 75 |
+
layerscale: 1.0e-05
|
| 76 |
+
drop_path_uniform: true
|
| 77 |
+
pretrained_weights: ''
|
| 78 |
+
ffn_layer: "mlp"
|
| 79 |
+
block_chunks: 0
|
| 80 |
+
qkv_bias: true
|
| 81 |
+
proj_bias: true
|
| 82 |
+
ffn_bias: true
|
| 83 |
+
num_register_tokens: 4
|
| 84 |
+
interpolate_antialias: false
|
| 85 |
+
interpolate_offset: 0.1
|
| 86 |
+
teacher:
|
| 87 |
+
momentum_teacher: 0.992
|
| 88 |
+
final_momentum_teacher: 1
|
| 89 |
+
warmup_teacher_temp: 0.04
|
| 90 |
+
teacher_temp: 0.07
|
| 91 |
+
warmup_teacher_temp_epochs: 30
|
| 92 |
+
optim:
|
| 93 |
+
epochs: 100
|
| 94 |
+
weight_decay: 0.04
|
| 95 |
+
weight_decay_end: 0.4
|
| 96 |
+
base_lr: 0.004 # learning rate for a batch size of 1024
|
| 97 |
+
lr: 0. # will be set after applying scaling rule
|
| 98 |
+
warmup_epochs: 10
|
| 99 |
+
min_lr: 1.0e-06
|
| 100 |
+
clip_grad: 3.0
|
| 101 |
+
freeze_last_layer_epochs: 1
|
| 102 |
+
freeze_backbone_layer_epochs: 0
|
| 103 |
+
scaling_rule: sqrt_wrt_1024
|
| 104 |
+
patch_embed_lr_mult: 0.2
|
| 105 |
+
layerwise_decay: 0.9
|
| 106 |
+
adamw_beta1: 0.9
|
| 107 |
+
adamw_beta2: 0.999
|
| 108 |
+
crops:
|
| 109 |
+
global_crops_scale:
|
| 110 |
+
- 0.32
|
| 111 |
+
- 1.0
|
| 112 |
+
local_crops_number: 8
|
| 113 |
+
local_crops_scale:
|
| 114 |
+
- 0.05
|
| 115 |
+
- 0.32
|
| 116 |
+
global_crops_size: 224
|
| 117 |
+
local_crops_size: 96
|
| 118 |
+
evaluation:
|
| 119 |
+
eval_period_iterations: 12500
|
FoMo4Wheat/configs/train/vitg_14_224.yaml
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dino:
|
| 2 |
+
head_n_prototypes: 131072
|
| 3 |
+
head_bottleneck_dim: 384
|
| 4 |
+
ibot:
|
| 5 |
+
separate_head: true
|
| 6 |
+
head_n_prototypes: 131072
|
| 7 |
+
train:
|
| 8 |
+
batch_size_per_gpu: 12
|
| 9 |
+
dataset_path: TestDataset
|
| 10 |
+
centering: sinkhorn_knopp
|
| 11 |
+
student:
|
| 12 |
+
arch: vit_giant2
|
| 13 |
+
patch_size: 14
|
| 14 |
+
drop_path_rate: 0.4
|
| 15 |
+
ffn_layer: swiglufused
|
| 16 |
+
block_chunks: 4
|
| 17 |
+
pretrained_weights: ''
|
| 18 |
+
teacher:
|
| 19 |
+
momentum_teacher: 0.994
|
| 20 |
+
pretrained_weights: ''
|
| 21 |
+
optim:
|
| 22 |
+
epochs: 200
|
| 23 |
+
weight_decay_end: 0.2
|
| 24 |
+
base_lr: 6.25e-05 # learning rate for a batch size of 1024
|
| 25 |
+
warmup_epochs: 40
|
| 26 |
+
layerwise_decay: 1.0
|
| 27 |
+
freeze_last_layer_epochs: 0
|
| 28 |
+
freeze_backbone_layer_epochs: 20
|
| 29 |
+
crops:
|
| 30 |
+
local_crops_size: 98
|
FoMo4Wheat/configs/train/vitg_14_518.yaml
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dino:
|
| 2 |
+
head_n_prototypes: 131072
|
| 3 |
+
head_bottleneck_dim: 384
|
| 4 |
+
ibot:
|
| 5 |
+
separate_head: true
|
| 6 |
+
head_n_prototypes: 131072
|
| 7 |
+
train:
|
| 8 |
+
batch_size_per_gpu: 2
|
| 9 |
+
dataset_path: ImageNet22k
|
| 10 |
+
centering: sinkhorn_knopp
|
| 11 |
+
student:
|
| 12 |
+
arch: vit_giant2
|
| 13 |
+
patch_size: 14
|
| 14 |
+
drop_path_rate: 0.4
|
| 15 |
+
ffn_layer: swiglufused
|
| 16 |
+
block_chunks: 4
|
| 17 |
+
pretrained_weights: ''
|
| 18 |
+
teacher:
|
| 19 |
+
momentum_teacher: 0.994
|
| 20 |
+
pretrained_weights: ''
|
| 21 |
+
optim:
|
| 22 |
+
epochs: 75
|
| 23 |
+
weight_decay_end: 0.2
|
| 24 |
+
base_lr: 1e-06 # learning rate for a batch size of 1024
|
| 25 |
+
min_lr: 1e-07
|
| 26 |
+
warmup_epochs: 0
|
| 27 |
+
layerwise_decay: 1.0
|
| 28 |
+
freeze_last_layer_epochs: 0
|
| 29 |
+
freeze_backbone_layer_epochs: 20
|
| 30 |
+
crops:
|
| 31 |
+
local_crops_size: 98
|
| 32 |
+
global_crops_size: 518
|
FoMo4Wheat/configs/y_distill_default_config.yaml
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MODEL:
|
| 2 |
+
WEIGHTS: ''
|
| 3 |
+
compute_precision:
|
| 4 |
+
grad_scaler: true
|
| 5 |
+
teacher:
|
| 6 |
+
backbone:
|
| 7 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 8 |
+
mixed_precision:
|
| 9 |
+
param_dtype: fp16
|
| 10 |
+
reduce_dtype: fp16
|
| 11 |
+
buffer_dtype: fp32
|
| 12 |
+
dino_head:
|
| 13 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 14 |
+
mixed_precision:
|
| 15 |
+
param_dtype: fp16
|
| 16 |
+
reduce_dtype: fp16
|
| 17 |
+
buffer_dtype: fp32
|
| 18 |
+
ibot_head:
|
| 19 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 20 |
+
mixed_precision:
|
| 21 |
+
param_dtype: fp16
|
| 22 |
+
reduce_dtype: fp16
|
| 23 |
+
buffer_dtype: fp32
|
| 24 |
+
student:
|
| 25 |
+
backbone:
|
| 26 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 27 |
+
mixed_precision:
|
| 28 |
+
param_dtype: bf16
|
| 29 |
+
reduce_dtype: bf16
|
| 30 |
+
buffer_dtype: fp32
|
| 31 |
+
dino_head:
|
| 32 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 33 |
+
mixed_precision:
|
| 34 |
+
param_dtype: bf16
|
| 35 |
+
reduce_dtype: fp32
|
| 36 |
+
buffer_dtype: fp32
|
| 37 |
+
ibot_head:
|
| 38 |
+
sharding_strategy: SHARD_GRAD_OP
|
| 39 |
+
mixed_precision:
|
| 40 |
+
param_dtype: bf16
|
| 41 |
+
reduce_dtype: fp32
|
| 42 |
+
buffer_dtype: fp32
|
| 43 |
+
dino:
|
| 44 |
+
loss_weight: 1.0
|
| 45 |
+
head_n_prototypes: 131072
|
| 46 |
+
head_bottleneck_dim: 384
|
| 47 |
+
head_nlayers: 3
|
| 48 |
+
head_hidden_dim: 2048
|
| 49 |
+
koleo_loss_weight: -1
|
| 50 |
+
ibot:
|
| 51 |
+
loss_weight: 1.0
|
| 52 |
+
mask_sample_probability: 0.5
|
| 53 |
+
mask_ratio_min_max:
|
| 54 |
+
- 0.1
|
| 55 |
+
- 0.5
|
| 56 |
+
separate_head: True
|
| 57 |
+
head_n_prototypes: 131072
|
| 58 |
+
head_bottleneck_dim: 256
|
| 59 |
+
head_nlayers: 3
|
| 60 |
+
head_hidden_dim: 2048
|
| 61 |
+
train:
|
| 62 |
+
batch_size_per_gpu: 64
|
| 63 |
+
dataset_path: ImageNet:split=TRAIN
|
| 64 |
+
output_dir: .
|
| 65 |
+
saveckp_freq: 20
|
| 66 |
+
seed: 0
|
| 67 |
+
num_workers: 6
|
| 68 |
+
OFFICIAL_EPOCH_LENGTH: 1250
|
| 69 |
+
cache_dataset: true
|
| 70 |
+
centering: sinkhorn_knopp
|
| 71 |
+
student:
|
| 72 |
+
arch: vit_base
|
| 73 |
+
patch_size: 14
|
| 74 |
+
drop_path_rate: 0.0
|
| 75 |
+
layerscale: 1.0e-05
|
| 76 |
+
drop_path_uniform: true
|
| 77 |
+
pretrained_weights: ''
|
| 78 |
+
ffn_layer: "mlp"
|
| 79 |
+
block_chunks: 4
|
| 80 |
+
qkv_bias: true
|
| 81 |
+
proj_bias: true
|
| 82 |
+
ffn_bias: true
|
| 83 |
+
num_register_tokens: 4
|
| 84 |
+
interpolate_offset: 0.1
|
| 85 |
+
interpolate_antialias : false
|
| 86 |
+
teacher:
|
| 87 |
+
arch: vit_giant2
|
| 88 |
+
patch_size: 14
|
| 89 |
+
drop_path_rate: 0.4
|
| 90 |
+
layerscale: 1.0e-05
|
| 91 |
+
drop_path_uniform: true
|
| 92 |
+
pretrained_weights: '/hpc/home/2023222003/Phenix/wheat/foundation_model/distill_pretrain/518_vitg/downsampling_pos_embed_from_518_to_224__checkpoint.pth'
|
| 93 |
+
ffn_layer: "swiglufused"
|
| 94 |
+
block_chunks: 4
|
| 95 |
+
qkv_bias: true
|
| 96 |
+
proj_bias: true
|
| 97 |
+
ffn_bias: true
|
| 98 |
+
momentum_teacher: 0.994
|
| 99 |
+
final_momentum_teacher: 1
|
| 100 |
+
warmup_teacher_temp: 0.04
|
| 101 |
+
teacher_temp: 0.07
|
| 102 |
+
warmup_teacher_temp_epochs: 30
|
| 103 |
+
num_register_tokens: 4
|
| 104 |
+
interpolate_offset: 0.1
|
| 105 |
+
interpolate_antialias : false
|
| 106 |
+
optim:
|
| 107 |
+
epochs: 100
|
| 108 |
+
weight_decay: 0.04
|
| 109 |
+
weight_decay_end: 0.2
|
| 110 |
+
base_lr: 1e-04 # learning rate for a batch size of 1024
|
| 111 |
+
lr: 0. # will be set after applying scaling rule
|
| 112 |
+
warmup_epochs: 10
|
| 113 |
+
min_lr: 1.0e-06
|
| 114 |
+
clip_grad: 3.0
|
| 115 |
+
freeze_last_layer_epochs: 0
|
| 116 |
+
scaling_rule: sqrt_wrt_1024
|
| 117 |
+
patch_embed_lr_mult: 0.2
|
| 118 |
+
layerwise_decay: 1
|
| 119 |
+
adamw_beta1: 0.9
|
| 120 |
+
adamw_beta2: 0.999
|
| 121 |
+
crops:
|
| 122 |
+
global_crops_scale:
|
| 123 |
+
- 0.32
|
| 124 |
+
- 1.0
|
| 125 |
+
local_crops_number: 8
|
| 126 |
+
local_crops_scale:
|
| 127 |
+
- 0.05
|
| 128 |
+
- 0.32
|
| 129 |
+
global_crops_size: 224
|
| 130 |
+
local_crops_size: 98
|
| 131 |
+
evaluation:
|
| 132 |
+
eval_period_iterations: 2500
|
FoMo4Wheat/data/__init__.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
| 2 |
+
#
|
| 3 |
+
# This source code is licensed under the Apache License, Version 2.0
|
| 4 |
+
# found in the LICENSE file in the root directory of this source tree.
|
| 5 |
+
|
| 6 |
+
from .adapters import DatasetWithEnumeratedTargets
|
| 7 |
+
from .loaders import make_data_loader, make_dataset, SamplerType
|
| 8 |
+
from .collate import collate_data_and_cast
|
| 9 |
+
from .masking import MaskingGenerator
|
| 10 |
+
from .augmentations import DataAugmentationDINO
|
FoMo4Wheat/data/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (480 Bytes). View file
|
|
|
FoMo4Wheat/data/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (588 Bytes). View file
|
|
|
FoMo4Wheat/data/__pycache__/__init__.cpython-39.pyc
ADDED
|
Binary file (478 Bytes). View file
|
|
|
FoMo4Wheat/data/__pycache__/adapters.cpython-310.pyc
ADDED
|
Binary file (1.41 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/adapters.cpython-311.pyc
ADDED
|
Binary file (1.97 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/adapters.cpython-39.pyc
ADDED
|
Binary file (1.41 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/augmentations.cpython-310.pyc
ADDED
|
Binary file (2.62 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/augmentations.cpython-311.pyc
ADDED
|
Binary file (5.11 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/augmentations.cpython-39.pyc
ADDED
|
Binary file (2.61 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/collate.cpython-310.pyc
ADDED
|
Binary file (1.62 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/collate.cpython-311.pyc
ADDED
|
Binary file (3.61 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/collate.cpython-39.pyc
ADDED
|
Binary file (1.65 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/loaders.cpython-310.pyc
ADDED
|
Binary file (5.66 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/loaders.cpython-311.pyc
ADDED
|
Binary file (8.86 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/loaders.cpython-39.pyc
ADDED
|
Binary file (5.6 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/masking.cpython-310.pyc
ADDED
|
Binary file (2.32 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/masking.cpython-311.pyc
ADDED
|
Binary file (4.14 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/masking.cpython-39.pyc
ADDED
|
Binary file (2.29 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/samplers.cpython-310.pyc
ADDED
|
Binary file (6.53 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/samplers.cpython-311.pyc
ADDED
|
Binary file (11.7 kB). View file
|
|
|
FoMo4Wheat/data/__pycache__/samplers.cpython-39.pyc
ADDED
|
Binary file (6.46 kB). View file
|
|
|