Skip to content

Commit

Permalink
Merge pull request #2 from vbvg2008/master
Browse files Browse the repository at this point in the history
added pipeline benchmark example
  • Loading branch information
jphong89 authored Jun 17, 2019
2 parents 692d6ed + 0b89071 commit 0d2ceb1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions benchmark/pipeline_performance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from fastestimator.pipeline.static.preprocess import Minmax
from fastestimator.pipeline.pipeline import Pipeline
import tensorflow as tf
import numpy as np

(x_train, y_train), (x_eval, y_eval) = tf.keras.datasets.mnist.load_data()
x_train = np.expand_dims(x_train, -1)

pipeline = Pipeline(batch_size=32,
feature_name=["x", "y"],
train_data={"x": x_train, "y": y_train},
validation_data= {"x": x_eval, "y": y_eval},
transform_train= [[Minmax()], []])

pipeline.benchmark(num_steps=3000, mode="train")

0 comments on commit 0d2ceb1

Please sign in to comment.