/rnm

Relational Neural Machines, first implemented https://doi.org/10.48550/arXiv.2002.02193

Primary LanguagePython

MiniMax Entropy Models

MiniMax Entropy Models.

Author

This program was created by Giuseppe Marra and his collaborators.

About

The current implementation is developed on top of the Relational Neural Machines, first introduced by Giuseppe Marra, Michelangelo Diligenti, Francesco Giannini, Marco Gori and Marco Maggini from the Department of Information Engineering of the University of Florence and from the University of Siena.

DOI:10.48550

Current tests on Google Colab:

Open In Colab

Relational Neural Networks background

Proposed solution

Network Architecture

Results

MNIST

The Neural Network employed in MNIST is

Architecture NN

CiteSeer

The Neural Network employed in CiteSeer is

Architecture NN

Getting Started

Follow these instructions to set up the project on your PC.

Moreover, to facilitate the use of the application, a Makefile has been provided; to see its functions, simply call the appropriate help command with GNU/Make

make help

1. Clone the repository

git clone https://github.com/samuelebortolotti/rnm.git
cd rnm

2. Install the requirements

pip install --upgrade pip
pip install -r requirements.txt

Note: it might be convenient to create a virtual environment to handle the dependencies.

The Makefile provides a simple and convenient way to manage Python virtual environments (see venv). In order to create the virtual environment and install the requirements be sure you have the Python 3.9 (it should work even with more recent versions, however I have tested it only with 3.9)

make env
source ./venv/rnm/bin/activate
make install

Remember to deactivate the virtual environment once you have finished dealing with the project

deactivate

3. Generate the code documentation

The automatic code documentation is provided Sphinx v4.5.0.

In order to have the code documentation available, you need to install the development requirements

pip install --upgrade pip
pip install -r requirements.dev.txt

Since Sphinx commands are quite verbose, I suggest you to employ the following commands using the Makefile.

make doc-layout
make doc

The generated documentation will be accessible by opening docs/build/html/index.html in your browser, or equivalently by running

make open-doc

However, for the sake of completeness one may want to run the full Sphinx commands listed here.

sphinx-quickstart docs --sep --no-batchfile --project reational-neural-machines --author "Giuseppe Marra et al., Samuele Bortolotti"  -r 0.1  --language en --extensions sphinx.ext.autodoc --extensions sphinx.ext.napoleon --extensions sphinx.ext.viewcode --extensions myst_parser
sphinx-apidoc -P -o docs/source .
cd docs; make html

Note: executing the second list of command will lead to a slightly different documentation with respect to the one generated by the Makefile. This is because the above listed commands do not customize the index file of Sphinx. This is because the above listed commands do not customize the index file of Sphinx.