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)
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)
def UnpackPackJob(a: oft.Numpy.Placeholder((3, 4))): return flow.pack(flow.unpack(a, 3), 3)
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)