求解 新手入门---线性回归中的部分 疑惑
Created by: wwlaoxi
1、怎么样查看uci_housing的数据? 2、打印相关信息
event_handler to print training and testing info
def event_handler(event): if isinstance(event, paddle.event.EndIteration): if event.batch_id % 100 == 0: print "Pass %d, Batch %d, Cost %f" % ( event.pass_id, event.batch_id, event.cost)
if isinstance(event, paddle.event.EndPass):
result = trainer.test(
reader=paddle.batch(
uci_housing.test(), batch_size=2),
feeding=feeding)
print "Test %d, Cost %f" % (event.pass_id, result.cost)
打印出来的结果如下 Pass 0, Batch 0, Cost 5.598552 Pass 0, Batch 100, Cost 32.202789 Pass 0, Batch 200, Cost 87.088058 Test 0, Cost 13.278372 Pass 1, Batch 0, Cost 78.872978 Pass 1, Batch 100, Cost 424.313202 Pass 1, Batch 200, Cost 12.719980 Test 1, Cost 13.332345 关于那个print "Test %d, Cost %f" % (event.pass_id, result.cost) 代表result.cost 是一个batch的cost,还是说uci_housing.test()所有的cost啊?