Edit by browser
This commit is contained in:
parent
89b0072313
commit
f964efd994
|
@ -157,10 +157,10 @@ def train_net(args, model, epoch_size, mnist_path, repeat_size, ckpoint_cb):
|
||||||
print("============== Starting Training ==============")
|
print("============== Starting Training ==============")
|
||||||
# load training dataset
|
# load training dataset
|
||||||
# 请在此添加代码完成本关任务
|
# 请在此添加代码完成本关任务
|
||||||
# **********Begin*********#
|
#********** Begin *********#
|
||||||
##提示:完成网络的配置
|
## 提示:完成网络的配置
|
||||||
|
|
||||||
# **********End**********#
|
#********** End **********#
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser(description='MindSpore LeNet Example')
|
parser = argparse.ArgumentParser(description='MindSpore LeNet Example')
|
||||||
|
@ -183,10 +183,10 @@ if __name__ == "__main__":
|
||||||
# define the optimizer
|
# define the optimizer
|
||||||
net_opt = nn.Momentum(network.trainable_params(), lr, momentum)
|
net_opt = nn.Momentum(network.trainable_params(), lr, momentum)
|
||||||
# 请在此添加代码完成本关任务
|
# 请在此添加代码完成本关任务
|
||||||
# **********Begin*********#
|
#********** Begin *********#
|
||||||
##提示:配置模型保存
|
## 提示:配置模型保存
|
||||||
|
|
||||||
# **********End**********#
|
#********** End **********#
|
||||||
# group layers into an object with training and evaluation features
|
# group layers into an object with training and evaluation features
|
||||||
model = Model(network, net_loss, net_opt, metrics={"Accuracy": Accuracy()})
|
model = Model(network, net_loss, net_opt, metrics={"Accuracy": Accuracy()})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue