Skip to content

Commit

Permalink
Update README and finish pypi readiness.
Browse files Browse the repository at this point in the history
  • Loading branch information
instance01 committed Jul 1, 2021
1 parent 66a484f commit 871e54f
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,3 +9,4 @@ qubo_nn/datasets/*
*.bak
runs*/
qubo_nn/models/*.pickle
dist/
17 changes: 17 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,17 @@
MIT License
Copyright (c) 2018 InstanceLabs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
24 changes: 17 additions & 7 deletions README.md
@@ -1,6 +1,6 @@
## QUBO - NN

<img alt="qubo heat map" src="qubo_nn/plots/qubo_map_singles.png">
<img alt="qubo heat map" src="https://raw.githubusercontent.com/instance01/qubo-nn/master/qubo_nn/plots/qubo_map_singles.png">
<p align="center">
9 problems and their respective QUBO matrices.
</p>
Expand All @@ -14,6 +14,10 @@ Now, these matrices are quite an interesting construct.. Thus, a few questions a

Let's find out.

```
pip install qubo-nn
```

## Project Structure

|File|Purpose|
Expand Down Expand Up @@ -49,6 +53,12 @@ Problems implemented so far:

## Setup

```
pip install qubo-nn
```

OR

```
pip3 install -r requirements.txt
pip3 install -e .
Expand Down Expand Up @@ -130,7 +140,7 @@ The list of problems can be found in `qubo_nn/problems/__init__.py`. Also:

The pipeline of interest is as follows.

<img alt="Reverse-engineering pipeline/architecture." src="qubo_nn/plots/architecture.png">
<img alt="Reverse-engineering pipeline/architecture." src="https://raw.githubusercontent.com/instance01/qubo-nn/master/qubo_nn/plots/architecture.png">

Given some QUBO matrix that was generated using a set of problem parameters, we first classify the problem in step a and then predict the parameters in step b.

Expand All @@ -145,19 +155,19 @@ sizes such as 32x32. The smaller sizes are zero-padded to the biggest supported
size, which most of the time is 64x64 and in rare cases goes up to 144x144 (for
Quadratic Assignment).

<img alt="Avg total misclassification rate" src="qubo_nn/plots/tot_mc_100_genX_100_genX.png">
<img alt="Avg total misclassification rate" src="https://raw.githubusercontent.com/instance01/qubo-nn/master/qubo_nn/plots/tot_mc_100_genX_100_genX.png">

The t-SNE plot for this experiment is shown below.

<img alt="t-SNE" src="qubo_nn/plots/tsne_100_genX_10.png">
<img alt="t-SNE" src="https://raw.githubusercontent.com/instance01/qubo-nn/master/qubo_nn/plots/tsne_100_genX_10.png">

### Reverse regression

This is preliminary. Some of the problems are easily learned by a neural network regressor. Each line represents 10 models and includes the 95% confidence interval.

<img alt="Reversal regression losses over multiple problems" src="qubo_nn/plots/reverse_loss.png">
<img alt="Reversal regression losses over multiple problems" src="https://raw.githubusercontent.com/instance01/qubo-nn/master/qubo_nn/plots/reverse_loss.png">

<img alt="Reversal regression R**2 over multiple problems" src="qubo_nn/plots/reverse_r2.png">
<img alt="Reversal regression R**2 over multiple problems" src="https://raw.githubusercontent.com/instance01/qubo-nn/master/qubo_nn/plots/reverse_r2.png">

### Reversibility

Expand Down Expand Up @@ -190,7 +200,7 @@ Reversing some problems like Quadratic Knapsack might be possible - an algorithm
The figure below shows that there are major differences between problem classes
in terms of their overall redundancy.

<img alt="Redundacy of QUBos with AutoEncoders, R**2" src="qubo_nn/plots/red_ae_all_matrix.png">
<img alt="Redundacy of QUBos with AutoEncoders, R**2" src="https://raw.githubusercontent.com/instance01/qubo-nn/master/qubo_nn/plots/red_ae_all_matrix.png">

## Contributing

Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
@@ -0,0 +1,3 @@
# Inside of setup.cfg
[metadata]
description-file = README.md
7 changes: 6 additions & 1 deletion setup.py
Expand Up @@ -2,13 +2,14 @@

setup(
name='qubo-nn',
version='0.2.1',
version='0.2.3',
install_requires=[
'numpy', 'networkx', 'torchvision', 'torch', 'dwave-qbsolv',
'qubovert', 'matplotlib', 'scipy', 'tensorflow', 'sklearn',
'tensorboard',
'ml-pyxis@git+https://github.com/vicolab/ml-pyxis@master',
],
long_description_content_type='text/markdown',
description='QUBO translations for 14 problems. Also: Reverse-engeering and AutoEncoders for QUBOs.',
url='https://github.com/instance01/qubo-nn',
author='Instance01',
Expand All @@ -20,6 +21,10 @@
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
'Topic :: Scientific/Engineering :: Physics',
'Topic :: Software Development :: Libraries',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Intended Audience :: Science/Research'
],
long_description=open('README.md').read(),
zip_safe=False)

0 comments on commit 871e54f

Please sign in to comment.