!5626 fix readme file for thor optimizer

Merge pull request !5626 from wangmin0104/master
pull/5626/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit d31c158faf

@ -58,7 +58,7 @@ After installing MindSpore via the official website, you can start training and
- Running on Ascend - Running on Ascend
```python ```python
# run distributed training example # 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 # run evaluation example
sh run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH] sh run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]
@ -68,7 +68,7 @@ sh run_eval.sh [DATASET_PATH] [CHECKPOINT_PATH]
- Running on GPU - Running on GPU
```python ```python
# run distributed training example # 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 # run evaluation example
sh run_eval_gpu.sh [DATASET_PATH] [CHECKPOINT_PATH] 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 "loss_scale": 128, # loss scale
"momentum": 0.9, # momentum of THOR optimizer "momentum": 0.9, # momentum of THOR optimizer
"weight_decay": 5e-4, # weight decay "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": 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 "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 "keep_checkpoint_max": 15, # only keep the last keep_checkpoint_max checkpoint
"save_checkpoint_path": "./", # path to save checkpoint relative to the executed path "save_checkpoint_path": "./", # path to save checkpoint relative to the executed path
"label_smooth": True, # label smooth "label_smooth": True, # label smooth
"label_smooth_factor": 0.1, # label smooth factor "label_smooth_factor": 0.1, # label smooth factor
"lr_init": 0.04, # learning rate init value "lr_init": 0.05672, # learning rate init value
"lr_decay": 5, # learning rate decay rate value "lr_decay": 4.9687, # learning rate decay rate value
"lr_end_epoch": 58, # learning rate end epoch value "lr_end_epoch": 50, # learning rate end epoch value
"damping_init": 0.02, # damping init value for Fisher information matrix "damping_init": 0.02345, # damping init value for Fisher information matrix
"damping_decay": 0.87, # damping decay rate "damping_decay": 0.5467, # damping decay rate
"frequency": 834, # the step interval to update second-order information matrix "frequency": 834, # the step interval to update second-order information matrix
``` ```
### Training Process ### Training Process

@ -118,7 +118,7 @@ if __name__ == '__main__':
# define net # define net
step_size = dataset.get_dataset_size() 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) 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, net = resnet50(class_num=config.class_num, damping=damping, loss_scale=config.loss_scale,
frequency=config.frequency, batch_size=config.batch_size) frequency=config.frequency, batch_size=config.batch_size)

Loading…
Cancel
Save