NNexpy (A bunch of python script and classes to experiment with homology, knot theory and neural networks)
This repository is a compilation of my work during my master course at Kyushu Institute of Technology. A clone of the repository is also available on KIT Honda Lab's github. The purpose of this repository is to provide with some python code to get started with homology and knot theory as a mean to evaluate neural networks' expressiveness.
To run this code you need python3 as well as some libraries. They can be installed using Conda and I personally used a conda environment which environment file is available in this repository.
To setup a functional conda environment with conda cli you simply need to use the following command:
conda env create -f environment.yml
conda activate nexpy
For more information refer to conda documentation and in particular the section about managing environment
To use this code, copy the nnexpy folder in your python project and import nnexpy
import nnexpy
NNexpy contains the following classes:
The examples
folder is a collection of the various scripts I have been creating during my research. Here follows a short description of all of them.
ai_playground.py
: Generates a fewDataInstance
with different homology and then callrasScript
to train batch of networks on these different datasets.analyse_network.py
: Computes betti numbers and makes the PCA to obtain a trajectory from Keras + Tensorflow neural network.bettiScript.py
: Computes Betti numbers of Keras + Tensorflow neural networks on aDataDescriptor
oldBottleneckScript.py
: Computes Betti numbers of Keras + Tensorflow neural networks on aDataDescriptor
compare_results.py
: Script to usebettiScript
,oldBettiScript
andoldBottleneckScript
as subprocessesoldBettiScript.py
: Another version of betti number computation of Keras + Tensorflow neural networks on aDataDescriptor
rasScript.py
: Trains a Keras + Tensorflow neural network on a givenDataInstance
test_random_networks.py
: Generate PCA of random networks with an input trajectoryvisualize_results.py
: Plot the predicted data of Keras + Tensorflow networks on aDataInstance