提交 91cf2f68 编写于 作者: C ceci3

update

上级 82103cf1
...@@ -133,8 +133,7 @@ for step in range(100): ...@@ -133,8 +133,7 @@ for step in range(100):
paddle.dataset.cifar.test10(cycle=False), paddle.dataset.cifar.test10(cycle=False),
batch_size=batch_size, batch_size=batch_size,
drop_last=False) drop_last=False)
train_feeder = fluid.DataFeeder( train_feeder = fluid.DataFeeder([image, label], place, program=train_program)
[image, label], place, program=train_program)
test_feeder = fluid.DataFeeder([image, label], place, program=test_program) test_feeder = fluid.DataFeeder([image, label], place, program=test_program)
...@@ -146,8 +145,7 @@ for step in range(100): ...@@ -146,8 +145,7 @@ for step in range(100):
feed=train_feeder.feed(data), feed=train_feeder.feed(data),
fetch_list=fetches)[0] fetch_list=fetches)[0]
if batch_id % 10 == 0: if batch_id % 10 == 0:
print( print('TRAIN: steps: {}, epoch: {}, batch: {}, cost: {}'.format(step, epoch_id, batch_id, outs[0]))
'TRAIN: steps: {}, epoch: {}, batch: {}, cost: {}'.format(step, epoch_id, batch_id, outs[0]))
### 开始预测,得到最终的测试结果作为score回传给sa_nas ### 开始预测,得到最终的测试结果作为score回传给sa_nas
reward = [] reward = []
...@@ -161,10 +159,8 @@ for step in range(100): ...@@ -161,10 +159,8 @@ for step in range(100):
reward_avg = np.mean(np.array(batch_reward), axis=1) reward_avg = np.mean(np.array(batch_reward), axis=1)
reward.append(reward_avg) reward.append(reward_avg)
print( print('TEST: step: {}, batch: {}, avg_cost: {}, acc_top1: {}'.
'TEST: step: {}, batch: {}, avg_cost: {}, acc_top1: {}'. format(step, batch_id, batch_reward[0],batch_reward[1]))
format(step, batch_id, batch_reward[0],
batch_reward[1]))
finally_reward = np.mean(np.array(reward), axis=0) finally_reward = np.mean(np.array(reward), axis=0)
print( print(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册