template class xf::data_analytics::regression::linearLeastSquareRegressionPredict

#include "linearRegression.hpp"


linear least square regression predict


MType datatype of regression, support double and float
D Number of features that processed each cycle
DDepth DDepth * D is max feature numbers supported.
RAMWeight Use which kind of RAM to store weight, could be LUTRAM, BRAM or URAM.
RAMIntercept Use which kind of RAM to store intercept, could be LUTRAM, BRAM or URAM.
template <
    typename MType,
    int D,
    int DDepth,
    RAMType RAMWeight,
    RAMType RAMIntercept
class linearLeastSquareRegressionPredict

// fields

sl2 <MType, D, DDepth, 1, 1,&funcMul <MType>,&funcSum <MType>,&funcAssign <MType>, AdditionLatency <MType>::value, RAMWeight, RAMIntercept> dotMulProcessor



void setWeight (
    MType inputW [D][DDepth],
    ap_uint <32> cols

set up weight parameters for prediction


inputW weight
cols Effective weight numbers


void setIntercept (MType inputI)

set up intercept parameters for prediction


inputI intercept should be set to zero if don’t needed.


void predict (
    hls::stream <MType> opStrm [D],
    hls::stream <bool>& eOpStrm,
    hls::stream <MType> retStrm [1],
    hls::stream <bool>& eRetStrm,
    ap_uint <32> cols

predict based on input features and preset weight and intercept


opStrm feature input streams. To get a vector of L features, opStrm will be read (L + D - 1) / D times. Feature 0 to D-1 will be read from opStrm[0] to opStrm[D-1] at the first time. Then feature D to 2*D - 1. The last round will readin fake data if L is not divisiable by D. These data won’t be used, just to allign D streams.
eOpStrm End flag of opStrm.
retStrm Prediction result.
eRetStrm End flag of retStrm.
cols Effective feature numbers.