edit

Optimize Your Model

Upon deploying your model, PipelineAI will optimize your model for high-performance serving and predicting.

Various model optimization and simplification techniques include folding batch normalizations, quantizing weights, and generating native code for both CPU and GPU.

Nvidia GPU

Intel CPU

Examples

TensorFlow

TensorFlow

Unoptimized Linear Regression

Unoptimized TensorFlow Linear Regression

Optimized Linear Regression

Optimized TensorFlow Linear Regression

Weight Quantization

Weight Quantization 1

Weight Quantization 2

Spark ML

Spark

Generate and Optimize Spark ML Model

Native Code Generation: Airbnb Price Prediction(Linear Regression)

public class Airbnb_Price_LinearRegressionModel {
  public Object predict(Map<String, Object> inputs) {
        Double bathrooms = (Double)inputs.get("bathrooms");
        Double bedrooms = (Double)inputs.get("bedrooms");
        Double square_feet = (Double)inputs.get("square_feet");
        String room_type = (String)inputs.get("room_type");
        String host_is_super_host = (String)inputs.get("host_is_super_host");
        String cancellation_policy = (String)inputs.get("cancellation_policy");
        ...        
        Double __regressionTableNumber00 = -31.985533969928042;
        if (room_type != null) {
            __regressionTableNumber00 += 25.89385313144676 * ((room_type.equals("Entire home/apt")) ? 1 : 0);
        }
        if (room_type != null) {
            __regressionTableNumber00 += -13.556162863521244 * ((room_type.equals("Private room")) ? 1 : 0);
        }
        if (host_is_super_host != null) {
            __regressionTableNumber00 += -5.761601400860295 * ((host_is_super_host.equals("0.0")) ? 1 : 0);
        }
        if (cancellation_policy != null) {
            __regressionTableNumber00 += 2.3566340923908315 * ((cancellation_policy.equals("strict")) ? 1 : 
        ...
        price = __regressionTableNumber00;

        return price;
    }
}

Native Code Generation: Income Prediction (Decision Tree)

public class Census_Income_DecisionTreeModel
    public Object predict(Map<String, Object> inputs) {
        String income = (String)nameToValue.get("income");
        String education = (String)nameToValue.get("education");
        String marital_status = (String)nameToValue.get("marital_status");
        String occupation = (String)nameToValue.get("occupation");
        String native_country = (String)nameToValue.get("native_country");
        Integer age = (Integer)nameToValue.get("age");
        Integer education_num = (Integer)nameToValue.get("education_num");
        Integer capital_gain = (Integer)nameToValue.get("capital_gain");
        Integer capital_loss = (Integer)nameToValue.get("capital_loss");
        Integer hours_per_week = (Integer)nameToValue.get("hours_per_week");
        income = "<=50K";
        Boolean __succ0 = false;
        if (!__succ0) {
            Integer __predicateValue1 = marital_status == null? 3 : (marital_status.equals("Married-civ-spouse") ? 2 : 1);
            if (__predicateValue1 == 1) {
                __succ0 = true;
                income = "<=50K";
                Boolean __succ2 = false;
                if (!__succ2) {
                    Integer __predicateValue3 = capital_gain == null? 3 : ((capital_gain <= 7688)? 1 : 2);
                    if (__predicateValue3 == 1) {
                        __succ2 = true;
                        income = "<=50K";
                        Boolean __succ4 = false;
                        if (!__succ4) {
                            Integer __predicateValue5 = education_num == null? 3 : ((education_num <= 13)? 1 : 2);
                            if (__predicateValue5 == 1) {
                                __succ4 = true;
                                income = "<=50K";
                                Boolean __succ6 = false;
        ...
        if (!__succ0) {
            income = null;
            resultExplanation = null;
        }

        return income;         
    }
} 


Try our Free Community Edition!

Click HERE to get started with our basic Community Edition

Register for PipelineAI Advanced Edition


Take a Quick, Fun Survey!


Help Us Improve

Option 1: Edit the documentation directly.

Option 2: Create a GitHub issue.