This repository is an realization of the algorithm proposed in this paper.
This code is written in Python 3. It requires:
- Gurobi Optimizer and gurobipy package (https://www.gurobi.com/), which have a free Academic License
- PyTen package (https://github.com/datamllab/pyten)
- Standard packages like Numpy, Scipy, etc.
-
Install Gurobi and gurobipy (https://www.gurobi.com/documentation/9.5/quickstart_windows/software_installation_guid.html)
-
Install PyTen package: The github code for PyTen is for Python 2. This zip archive contains the file "pyten-master-v3.zip". To install PyTen for Python 3, decompress this zip archive and run the command "python setup.py install" in the "pyten-master" folder.
-
Install any needed missing standard packages.
Run
conda env create -f environment.yml
to create the conda environment.
To run an experiment, use the command "python runexp.py". To change the problem instance, edit the file "runexp.py" in the section of the code labeled "EDIT THESE TO CHANGE THE PROBLEM SETUP". The problem instance is dicated by the variables:
-
"r" is a list of the tensor dimensions. A tensor with dimensions 10 x 20 x 30 x 40 would be specified with "r = (10,20,30,40)".
-
"n" is the number of samples (with repetition).
-
"corners" is the number of vertices from the norm-1 nonnegative tensor ball used to construct the "true tensor" using the procedure described in the manuscript.
-
"reps" is the number of times to repeat a single experiment.