Metadata-Version: 2.4
Name: uglad
Version: 2.0.0
Summary: A deep unrolled architecture to recover conditional independence graphs. A better alternative to BCD and other graphical lasso solvers.
Project-URL: Homepage, https://github.com/Harshs27/uglad
Project-URL: Bug Tracker, https://github.com/Harshs27/uglad/issues
Project-URL: Paper, https://arxiv.org/abs/2205.11610
Author-email: Harsh Shrivastava <harshshrivastava111@gmail.com>
License: uGLAD Non-Commercial License  
        Copyright © 2021 Harsh Shrivastava
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the “Software”), to use,
        copy, modify, merge, publish, and distribute the Software **for non-commercial
        purposes only**, subject to the following conditions:
        
        1. **Non-Commercial Use** — Use of the Software, in whole or in part, for
           commercial purposes is prohibited without prior written permission from the
           copyright holder.
        
        2. **Attribution** — You must give appropriate credit to the original author(s)
           in any public use of this Software.
        
        3. **Commercial Licensing** — To obtain a commercial license, please contact:
           harshshrivastava111@gmail.com
        
        4. **No Warranty** — 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.
License-File: LICENSE
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.13
Requires-Dist: matplotlib
Requires-Dist: networkx
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pyvis
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: torch
Requires-Dist: torchvision
Provides-Extra: dev
Requires-Dist: ipykernel; extra == 'dev'
Requires-Dist: notebook; extra == 'dev'
Description-Content-Type: text/markdown

## uGLAD  
Sparse graph recovery by optimizing deep unrolled networks. This work proposes `uGLAD` (Sparse graph recovery by optimizing deep unrolled networks. [arxiv](<https://arxiv.org/abs/2205.11610>)) which is a unsupervised version of a previous `GLAD` model (GLAD: Learning Sparse Graph Recovery (ICLR 2020 - [link](<https://openreview.net/forum?id=BkxpMTEtPB>)).  

## Talk  
https://www.youtube.com/watch?v=Mx9VSQJACsA

Key benefits & features:  
- Solution to Graphical Lasso: A better alternative to solve the Graphical Lasso problem as
    - The neural networks of the uGLAD enable adaptive choices of the hyperparameters which leads to better performance than the existing algorithms  
     - No need to pre-specify the sparsity related regularization hyperparameters  
    - Requires less number of iterations to converge due to neural network based acceleration of the unrolled optimization algorithm (Alternating Minimization)    
    - GPU based acceleration can be leveraged  
    - Novel `consensus` strategy which robustly handles missing values by leveraging the multi-task learning ability of the model   
    - Multi-task learning mode that solves the graphical lasso objective to recover multiple graphs with a single `uGLAD` model  
- Glasso loss function: The loss is the logdet objective of the graphical lasso `1/M(-1*log|theta|+ <S, theta>)`, where `M=num_samples, S=input covariance matrix, theta=predicted precision matrix`.  
- Ease of usability: Matches the I/O signature of `sklearn GraphicalLassoCV`, so easy to plug-in to the existing code.  

### uGLAD architecture: Unrolled deep model

<p align="center">
  <img src="https://github.com/Harshs27/uGLAD/blob/main/.images/architecture.PNG" width="100" title="uGLAD architecture: Unrolled deep model" />
</p>

<p align="center">
  <img src="https://github.com/Harshs27/uGLAD/blob/main/.images/nn-architecture1.PNG" width="300" title="uGLAD architecture: Neural Network details" />
</p>

## Setup 
### Users

```bash
pip install uglad
```

### Developers
The `setup.sh` file contains the complete procedure of creating a conda environment to run uGLAD model. 
```bash
bash setup.sh
```

## demo-uGLAD notebook  
A minimalist working example of uGLAD is given in `examples/demo-uGLAD.ipynb` notebook. It is a good entry point to understand the code structure as well as the uGLAD model.  

## Citation
If you find this method useful, kindly cite the following 2 associated papers:

- `uGLAD`: Sparse graph recovery by optimizing deep unrolled networks. [arxiv](<https://arxiv.org/abs/2205.11610>)  
@inproceedings{  
shrivastava2022a,  
title={A deep learning approach to recover conditional independence graphs},  
author={Harsh Shrivastava and Urszula Chajewska and Robin Abraham and Xinshi Chen},  
booktitle={NeurIPS 2022 Workshop: New Frontiers in Graph Learning},  
year={2022},  
url={https://openreview.net/forum?id=kEwzoI3Am4c}  
}  

- `GLAD`:  
@article{shrivastava2019glad,  
  title={GLAD: Learning sparse graph recovery},  
  author={Shrivastava, Harsh and Chen, Xinshi and Chen, Binghong and Lan, Guanghui and Aluru, Srinvas and Liu, Han and Song, Le},  
  journal={arXiv preprint arXiv:1906.00271},  
  year={2019}  
}     
