Giter Site home page Giter Site logo

gpu_badmm_mt's Introduction

Mass transportation problem: C, a, b.  The default a = 1, b = 1;
1. The file C,a,b for mass transportation problem are generated using matlab storing in a binary file in row-major order. For example,
m = 1024;
n = m;
C = rand(m,n);
fid = fopen([int2str(n) 'C.dat'],'w');
fwrite(fid,[m,n],'int');
fwrite(fid,C','float');
fclose(fid);

2. compile cuda code and tune parameters
nvcc -o badmm_mt badmm_mt.cu badmm_kernel.cu -lcublas -arch sm_13
nvprof ./badmm_mt dim_file_name rho max_iteration tolerance_stop_badmm num_steps_print save_output
a. dim_file_name: the name of cost matrix is stored in binary with name dim*1024C.dat. The name of a,b files are dim*1024a.dat and dim*1024b.dat
b. rho (float): the parameter of badmm
c. max_iteration (int): the maximum number of iterations of badmm
d. tol (float): the stopping condition of primal and dual residuals of badmm. If less than tol, badmm will stop.
e. num_steps_print (int): print intermediate results every num_steps_print step. If num_steps_print = 0, no print. 
f. save_output: write the final result of mass transportation into a binary file named X_out.dat
The default values will be chosen if setting them to zero or no specification


3. read X_out to matlab
fid = fopen('X_out.dat','r');
X = fread(fid,[n,m],'float');
fclose(fid);
X = X';

gpu_badmm_mt's People

Contributors

anteagle avatar

Watchers

Fangde Liu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.