Browse Source

Merge pull request 'update config.py' (#26) from liuzx into master

Reviewed-on: https://openi.pcl.ac.cn/OpenIOSSG/OpenI_Cloudbrain_Example/pulls/26
liuzx-patch-16
liuzx 2 years ago
parent
commit
d1a28492de
1 changed files with 20 additions and 15 deletions
  1. +20
    -15
      npu_mnist_example/config.py

+ 20
- 15
npu_mnist_example/config.py View File

@@ -16,19 +16,24 @@
network config setting, will be used in train.py network config setting, will be used in train.py
""" """
import os import os
os.system('pip install easydict')
from easydict import EasyDict as edict
class Config:
def __init__(self, **entries):
self.__dict__.update(entries)


mnist_cfg = edict({
'num_classes': 10,
'lr': 0.01,
'momentum': 0.9,
'epoch_size': 10,
'batch_size': 32,
'buffer_size': 1000,
'image_height': 32,
'image_width': 32,
'save_checkpoint_steps': 1875,
'keep_checkpoint_max': 150,
'air_name': "lenet",
})
def __getitem__(self, item):
return self.__dict__[item]

# 定义配置信息
mnist_cfg = Config(
num_classes=10,
lr=0.01,
momentum=0.9,
epoch_size=10,
batch_size=32,
buffer_size=1000,
image_height=32,
image_width=32,
save_checkpoint_steps=1875,
keep_checkpoint_max=150,
air_name="lenet"
)

Loading…
Cancel
Save