예제 #1
0
 def alexnet_train_job():
     (labels, images) = _data_load_layer(args, args.train_dir)
     loss = alexnet(args, images, labels)
     flow.optimizer.SGD(flow.optimizer.PiecewiseConstantScheduler(
         [], [0.00001]),
                        momentum=0).minimize(loss)
     return flow.pack(loss, args.num_piece_in_batch)
예제 #2
0
 def alexnet_eval_job():
     with flow.scope.consistent_view():
         (labels, images) = _data_load_layer(args, args.eval_dir)
         loss = alexnet(args, images, labels)
         return flow.pack(loss, args.num_piece_in_batch)
예제 #3
0
 def UnpackPackJob(a: oft.Numpy.Placeholder((3, 4))):
     return flow.pack(flow.unpack(a, 3), 3)
예제 #4
0
 def alexnet_train_job():
     (labels, images) = _data_load_layer(args, args.train_dir)
     loss = alexnet(args, images, labels)
     flow.losses.add_loss(loss)
     return flow.pack(loss, args.num_piece_in_batch)