The train part if based on the code in https://github.com/sliu2019/learned_sketch/
----------------------------------------------------------------------------------
Prerequisites

Install the necessary package and Download data at links provided in paper
----------------------------------------------------------------------------------
Main files

For training:

train_subspace_embedding.py: training the non-zeros entries of the sketch matrix, based on a random non-zero positions

leverge.py: compute the heavy rows of the train dataset, then generate the count-sketch matrix based on the statistics of heavy rows.

train_subspace_embedding.py: training the non-zeros entries of the sketch matrix, based on a non-zeros positions based on the heavy leverage score rows(you need first run leverge.py to generate it, then set the roadmap load it)

How to run

Fast download the dataset and put them in data//raw

example:python -u train_subspace_embedding.py --data ghg --m 84 --num_exp 10  --device cuda:0 --bs 20 --lr 10.00 --iter 500 

when first run it, use the commond --raw, which can process the raw dataset

------------------------------------------------------------------------------------------

For evaluation: the code of this part is based on https://github.com/c-dickens/sketching_optimisation(it contains the lasso part, then we add the other parts, based on its framework)

You can do like this:

		my_ihs = ihs(A_test[i], B_test[i], sketch_method, np.int(84))
        x = my_ihs.lasso_fit_new_sketch(1, 30) (1 iteration round, ell1 bound = 30)

for the random sketch.

For the learned sketch, you can do like this:

		my_ihs = ihs(A_test[i], B_test[i], sketch_method, np.int(84))
        x = my_ihs.lasso_fit_new_sketch_learn(1, 30)

In lasso_fit_new_sketch_learn, you need to first train the sketch then set the roadmap to load it.

The regression_solver.py can provide some solvers for the x_opt. (please use new_lasso_solver() for LASSO problem and nuclear_solver for the matrix estimation with nuclear norm constaint problem)


