The repository is structured as follows. We only describe the most important files for a new user.
./
|-- experiments
| |-- run_generate_architectures.py: Samples random architectures and compute FPT metrics.
| |-- run_randomized_experiment.py: Trains several neural networks based on architectures described in json files.
|-- freenn: Contains the numerical routines aimed at computing FPT densities.
|-- ipynb: Contains Python notebooks which demonstrate how the code works
| |-- DemoFPT.ipynb: Illustrates the measure concentration in FPT.
| |-- mc_vs_lilypads.ipynb: Benchmarks our method compared to Monte-Carlo sampling. Used to generate the benchmark figure (Fig. 1).
| |-- LossStatistics.ipynb: Once all the experiments have been run, this notebook computes correlation statistics and gives the scatter plot (Fig. 2).
|-- tests: Unit tests
|-- README.md: This fileNote that the dependencies have been left to a bare minimum in order to run the package freenn. Running the experiments however requires the installation of torch, torchvision and click via:
$ pip install torch torchvision click- Create new virtual environment
$ python3 -m venv .venv(Do sudo apt install python3-venv if needed)
- Activate virtual environment
$ source .venv/bin/activate- Upgrade pip, wheel and setuptools
$ pip install --upgrade pip
$ pip install --upgrade setuptools
$ pip install wheel- Install the
freennpackage.
python setup.py develop- (Optional) In order to use Jupyter with this virtual environment .venv
pip install --user ipykernel
python -m ipykernel install --user --name=myenv(see https://janakiev.com/blog/jupyter-virtual-envs/ for details)
Nothing to do
Later