From 0b89071238384cb011d0b98a31d7c3149fac9a37 Mon Sep 17 00:00:00 2001 From: vbvg2008 Date: Sun, 16 Jun 2019 10:30:49 -0700 Subject: [PATCH] added pipeline benchmark example --- benchmark/pipeline_performance.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 benchmark/pipeline_performance.py diff --git a/benchmark/pipeline_performance.py b/benchmark/pipeline_performance.py new file mode 100644 index 0000000..1e2125f --- /dev/null +++ b/benchmark/pipeline_performance.py @@ -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") \ No newline at end of file