mirror of
https://github.com/open-mmlab/mmclassification.git
synced 2025-06-03 21:53:55 +08:00
* remove basehead * add moco series * add byol simclr simsiam * add ut * update configs * add simsiam hook * add and refactor beit * update ut * add cae * update extract_feat * refactor cae * add mae * refactor data preprocessor * update heads * add maskfeat * add milan * add simmim * add mixmim * fix lint * fix ut * fix lint * add eva * add densecl * add barlowtwins * add swav * fix lint * update readtherdocs rst * update docs * update * Decrease UT memory usage * Fix docstring * update DALLEEncoder * Update model docs * refactor dalle encoder * update docstring * fix ut * fix config error * add val_cfg and test_cfg * refactor clip generator * fix lint * pass check * fix ut * add lars * update type of BEiT in configs * Use MMEngine style momentum in EMA. * apply mmpretrain solarize --------- Co-authored-by: mzr1996 <mzr1996@163.com>
45 lines
1.1 KiB
Python
45 lines
1.1 KiB
Python
_base_ = [
|
|
'../../_base_/datasets/imagenet_bs32_pil_resize.py',
|
|
'../../_base_/default_runtime.py',
|
|
]
|
|
|
|
# dataset settings
|
|
train_dataloader = dict(batch_size=128)
|
|
|
|
# model settings
|
|
model = dict(
|
|
type='ImageClassifier',
|
|
backbone=dict(
|
|
type='MoCoV3ViT',
|
|
arch='base', # embed_dim = 768
|
|
img_size=224,
|
|
patch_size=16,
|
|
stop_grad_conv1=True,
|
|
frozen_stages=12,
|
|
norm_eval=True),
|
|
head=dict(
|
|
type='VisionTransformerClsHead',
|
|
num_classes=1000,
|
|
in_channels=768,
|
|
loss=dict(type='CrossEntropyLoss', loss_weight=1.0),
|
|
init_cfg=dict(type='Normal', std=0.01, layer='Linear'),
|
|
))
|
|
|
|
# optimizer
|
|
optim_wrapper = dict(
|
|
type='OptimWrapper',
|
|
optimizer=dict(type='SGD', lr=12, momentum=0.9, weight_decay=0.))
|
|
|
|
# learning rate scheduler
|
|
param_scheduler = [
|
|
dict(type='CosineAnnealingLR', T_max=90, by_epoch=True, begin=0, end=90)
|
|
]
|
|
|
|
# runtime settings
|
|
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=90)
|
|
val_cfg = dict()
|
|
test_cfg = dict()
|
|
|
|
default_hooks = dict(
|
|
checkpoint=dict(type='CheckpointHook', interval=10, max_keep_ckpts=3))
|