2020-07-13 14:07:10:321
This commit is contained in:
commit
34dc39cdcc
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ if __name__ == '__main__':
|
|||
filepath = "./MindSpore/src/step2/step2.py"
|
||||
|
||||
if (object.objectFind(objs, filepath)):
|
||||
print("----------------")
|
||||
#print("----------------")
|
||||
|
||||
print("ok!")
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue