2020-07-13 14:07:10:321

This commit is contained in:
educoder 2020-07-13 14:07:10 +08:00
commit 34dc39cdcc
2 changed files with 5 additions and 6 deletions

View File

@ -14,7 +14,7 @@ if __name__ == "__main__":
# 请在此添加代码完成本关任务
#********** Begin *********#
## 提示:补全损失函数的定义
net_loss = SoftmaxCrossEntropyWithLogits(is_grad=False, sparse=True, reduction='mean')
#********** End **********#
repeat_size = epoch_size
# create the network
@ -22,12 +22,11 @@ if __name__ == "__main__":
# define the optimizer
# 请在此添加代码完成本关任务
#********** Begin *********#
## 提示:补全优化器的定义
net_opt = nn.Momentum(network.trainable_params(), lr, momentum)
config_ck = CheckpointConfig(save_checkpoint_steps=1875, keep_checkpoint_max=10)
## 提示:补全优化器的定义,使用 Momentum 优化器
#********** End **********#
config_ck = CheckpointConfig(save_checkpoint_steps=1875, keep_checkpoint_max=10)
# save the network model and parameters for subsequence fine-tuning
ckpoint_cb = ModelCheckpoint(prefix="checkpoint_lenet", config=config_ck)
# group layers into an object with training and evaluation features

View File

@ -18,7 +18,7 @@ if __name__ == '__main__':
filepath = "./MindSpore/src/step2/step2.py"
if (object.objectFind(objs, filepath)):
print("----------------")
#print("----------------")
print("ok!")
else: