fix readme file for resnet_thor

This commit is contained in:
wangmin 2020-09-01 16:39:47 +08:00
parent 529e1a0a81
commit c11e064e18
2 changed files with 9 additions and 9 deletions

View File

@ -58,7 +58,7 @@ After installing MindSpore via the official website, you can start training and
- Running on Ascend
```python
# run distributed training example
sh scripts/run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [DEVICE_NUM]
sh run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [DEVICE_NUM]
# run evaluation example
sh run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]
@ -68,7 +68,7 @@ sh run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]
- Running on GPU
```python
# run distributed training example
sh scripts/run_distribute_train_gpu.sh [DATASET_PATH] [DEVICE_NUM]
sh run_distribute_train_gpu.sh [DATASET_PATH] [DEVICE_NUM]
# run evaluation example
sh run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH]
@ -132,18 +132,18 @@ Parameters for both training and inference can be set in config.py.
"loss_scale": 128, # loss scale
"momentum": 0.9, # momentum of THOR optimizer
"weight_decay": 5e-4, # weight decay
"epoch_size": 45, # only valid for taining, which is always 1 for inference
"epoch_size": 40, # only valid for taining, which is always 1 for inference
"save_checkpoint": True, # whether save checkpoint or not
"save_checkpoint_epochs": 1, # the epoch interval between two checkpoints. By default, the checkpoint will be saved every epoch
"keep_checkpoint_max": 15, # only keep the last keep_checkpoint_max checkpoint
"save_checkpoint_path": "./", # path to save checkpoint relative to the executed path
"label_smooth": True, # label smooth
"label_smooth_factor": 0.1, # label smooth factor
"lr_init": 0.04, # learning rate init value
"lr_decay": 5, # learning rate decay rate value
"lr_end_epoch": 58, # learning rate end epoch value
"damping_init": 0.02, # damping init value for Fisher information matrix
"damping_decay": 0.87, # damping decay rate
"lr_init": 0.05672, # learning rate init value
"lr_decay": 4.9687, # learning rate decay rate value
"lr_end_epoch": 50, # learning rate end epoch value
"damping_init": 0.02345, # damping init value for Fisher information matrix
"damping_decay": 0.5467, # damping decay rate
"frequency": 834, # the step interval to update second-order information matrix
```
### Training Process

View File

@ -118,7 +118,7 @@ if __name__ == '__main__':
# define net
step_size = dataset.get_dataset_size()
damping = get_model_damping(0, config.damping_init, config.damping_decay, 90, step_size)
damping = get_model_damping(0, config.damping_init, config.damping_decay, 70, step_size)
lr = get_model_lr(0, config.lr_init, config.lr_decay, config.lr_end_epoch, step_size, decay_epochs=39)
net = resnet50(class_num=config.class_num, damping=damping, loss_scale=config.loss_scale,
frequency=config.frequency, batch_size=config.batch_size)