keras_uspmv_rt.py

class keras_uspmv_rt.KerasUspmvRT(keras_model, batch_sz, xclbin_opts)

runtime class to use USPMV in the keras example

It will send all the weights matrices loaded from the model to kernel for future usage

Parameters
  • keras_model (model) – pre-trained model

  • xclbin_opts (dictionary) – information read from config_info.dat used to build the xclbin

  • batch_sz (shape) – output prediction matrix size

predict(inp)

prepare input matrix for the engine, send all the matrices and instructions to kernel and get the result prediction matrix

Parameters

inp (array) – input matrix

Returns

result prediction matrix

Return type

array