Installation

ngc-learn officially supports Linux on Python 3. It can be run with or without a GPU.

Setup: ngc-learn, in its entirety (including its supporting utilities), requires that you ensure that you have installed the following base dependencies in your system. Note that this library was developed and tested on Ubuntu 22.04 (and 18.04). Specifically, ngc-learn requires:

  • Python (>=3.10)

  • ngcsimlib (>=0.2.b1), (official page)

  • NumPy (>=1.26.0)

  • SciPy (>=1.7.0)

  • JAX (>= 0.4.18; and jaxlib>=0.4.18)

  • Matplotlib (>=3.4.2), (for ngclearn.utils.viz)

  • Scikit-learn (>=1.3.1), (for ngclearn.utils.patch_utils and ngclearn.utils.density)

Note that the above requirements are taken care of if one installs ngc-learn through either pip. One can either install the CPU version of ngc-learn (if no JAX is pre-installed or only the CPU version of JAX is installed currently) via

$ pip install ngclearn

or install the GPU version of ngc-learn by first installing the CUDA 11 or 12 version of JAX before running the above pip command.

Alternatively, one may locally, step-by-step (see below), install and setup ngc-learn from source after pulling from the repo.

Note that installing the official pip package without any form of JAX installed on your system will default to downloading the CPU version of ngc-learn (see below for installing the GPU version).

Install from Source

  1. Clone the ngc-learn repository:

$ git clone https://github.com/NACLab/ngc-learn.git
$ cd ngc-learn
  1. (Optional; only for GPU version) Install JAX for either CUDA 11 or 12 , depending on your system setup. Follow the installation instructions on the official JAX page to properly install the CUDA 11 or 12 version.

  1. Install the ngc-learn package via:

$ pip install .

or, to install as an editable install for development, run:

$ pip install -e .

If the installation was successful, you should see the following if you test it against your Python interpreter, i.e., run the $ python command and complete the following sequence of steps as depicted in the screenshot below:
_images/test_ngclearn_install.png

Note: If you do not have a JSON configuration file in place (see tutorials for details) locally where you call the import to ngc-learn, a warning will pop up containing within it “UserWarning: Missing file to preload modules from.”; this still means that ngc-learn installed successfully but you will need to point to a JSON configuration when building projects with ngc-learn.