Esempio n. 1
0
def benchmark_logreg(ctx, timer):
  print "#worker:", ctx.num_workers
  #N_EXAMPLES = 40000000 * ctx.num_workers
  N_EXAMPLES = 5000000 * 64
  x = expr.eager(expr.rand(N_EXAMPLES, N_DIM, tile_hint=(N_EXAMPLES / ctx.num_workers, N_DIM)))
  y = expr.eager(expr.rand(N_EXAMPLES, 1, tile_hint=(N_EXAMPLES / ctx.num_workers, 1)))
  start = time.time()
  logistic_regression.logistic_regression(x, y, ITERATION)

  total = time.time() - start
  util.log_warn("time cost : %s s" % (total*1.0/ITERATION,))
Esempio n. 2
0
def benchmark_logreg(ctx, timer):
  print "#worker:", ctx.num_workers
  FLAGS.opt_parakeet_gen = 0
  N_EXAMPLES = 1000 * ctx.num_workers
  N_DIM = 512
  #N_EXAMPLES = 5000000 * 64
  x = expr.rand(N_EXAMPLES, N_DIM)
  y = expr.rand(N_EXAMPLES, 1)
  start = time.time()
  logistic_regression.logistic_regression(x, y, ITERATION)

  total = time.time() - start
  util.log_warn("time cost : %s s" % (total*1.0/ITERATION,))
Esempio n. 3
0
def benchmark_logreg(ctx, timer):
    print "#worker:", ctx.num_workers
    FLAGS.opt_parakeet_gen = 0
    N_EXAMPLES = 1000 * ctx.num_workers
    N_DIM = 512
    #N_EXAMPLES = 5000000 * 64
    x = expr.rand(N_EXAMPLES, N_DIM)
    y = expr.rand(N_EXAMPLES, 1)
    start = time.time()
    logistic_regression.logistic_regression(x, y, ITERATION)

    total = time.time() - start
    util.log_warn("time cost : %s s" % (total * 1.0 / ITERATION, ))