README.md 2.39 KiB
Newer Older
Andrew Ponomarev's avatar
Andrew Ponomarev committed
# OrGAN

Andrew Ponomarev's avatar
Andrew Ponomarev committed
OrGAN implements a procedure of training a generative adversarial neural network model for generation of organization structures with complex relation topology. It takes into account tacit expert knowledge based on the training dataset and parametric dependencies based on both the training dataset and programmed functional dependencies. 
Andrew Ponomarev's avatar
Andrew Ponomarev committed
For demonstration purposes, a fictitious but illustrative demo is included.


## Dependencies

* **python>=3.5**
* **pytorch>=0.4.1**: https://pytorch.org
* **numpy**

Andrew Ponomarev's avatar
Andrew Ponomarev committed
For more detailed list of requirements, see `requirements.txt`.


## Structure
Andrew Ponomarev's avatar
Andrew Ponomarev committed

* `data`: should contain organization structure dataset. You can use `generate_dataset` script to generate the demo dataset.


## Usage
```
python main.py
```
Andrew Ponomarev's avatar
Andrew Ponomarev committed

## Documentation

To generate documentation you'll need to have Sphinx installed in your machine. After that:

```
cd docs
make html
```

The HTML version of the documentation will appear in the `docs/_build` folder. 


## Testing

The tests are written using PyTest framework. There are two types of tests: unit tests, covering individual
functions and classes and integration tests, covering larger blocks (cooperations of classes, delivering some
complex functionality). These types of tests are distinguished using "marks" mechanism provided by PyTest. To 
run all thetests you can execute:
```
$ pytest
```
from the project root. As integration tests might take some time to complete, sometimes it might be convenient
to run only integration or only unit tests. To run only integration tests:
```
$ pytest -m integration
```
Finally, to run only unit tests:
```
$ pytest -m "not integration"
```

In some cases `pytest` script location is not in the `PATH`, so you
may have to run it via the full path, e.g.:
```
/home/tnn/.local/bin/pytest
```
(for exact path refer to your PyTest installation).


To evaluate test coverage:
```
coverage run -m pytest
coverage report organ/*.py organ/*/*.py
```

### Acknowledgement

OrGAN is based on some ideas from the MolGAN: An implicit generative model for small molecular graphs (https://arxiv.org/abs/1805.11973). However, unlike MolGAN, it is aimed for a different purpose, deals with parametric constituent and supports generation of parametrized organization structures taking into account input parameters.
* [yongqyu/MolGAN-pytorch](https://github.com/yongqyu/MolGAN-pytorch)
* [nicola-decao/MolGAN](https://github.com/nicola-decao/MolGAN)