Skip to content

Modified version of the Support Vector Machines optimization problem for targeting low precision posit representation at inference time

Notifications You must be signed in to change notification settings

terranovafr/MixedPrecisionSVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mixed Precision SVM

Real-time or power-constrained applications employ smaller number formats (posits) to result in smaller memory footprints, higher performance, and lower power consumption.
The key task of every efficient implementation is to identify the lowest working precision acceptable to achieve a classification accuracy comparable to a reference implementation in double-precision floating-point arithmetic.
The focus of this project is to realize a modified version of the Support Vector Machine optimization problem, that takes into account the fact that during the inference phase, the model will be executed on devices that use low precision posits.
In particular, the idea of this project is to modify the underlying optimization method during the training phase, modifying the constraints in the dual problem, in order to have better results at inference time with posits. image

Project Structure

The project is organized as follows:

  • matlab/ contains the matlab scripts used to load datasets and find the optimal solutions to the optimization problems
  • datasets/ contains the datasets used for evaluating our solution
  • main_lambdas.cpp contains the code used to perform inference starting from the dual optimal solutions (Scenarios 1,2,3)
  • main_wb.cpp contains the code used to perform inference starting from the primal optimal solutions (Scenarios 4,5)

Requirements to run the project

  • Matlab & Matlab Optimization Toolbox
  • cpp_posit library (external library needed to support the project)

How to use our solution

The Matlab scripts in the Matlab folder can be used in order to generate the primal/dual variables that can be used to simulate the different scenarios investigated in our project.
The scripts involving a model without constraints will output w and b and the dual variable lambdas in csv files.
The scripts involving a model with constraints will output w and b and the dual variables mu and eta in csv files.
The path of the files generated by the scripts can be set in the cpp scripts that will perform inference using posits.

  • main_lambdas.cpp will start from the values of lambda generated from a model without constraints or the values of mu and eta generated from a model with constraints, compute the decision functions and perform inference.
  • main_wb.cpp will start from the values of w and b generated from a model without constraints or with constraints and will perform inference. The value of b should be specified in the code, and the same holds for the file containing the weight vector w.

About

Modified version of the Support Vector Machines optimization problem for targeting low precision posit representation at inference time

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published