PBN Toolkit Quick start guide. This is trial version with compiled Python code (P-code) that can reproduce published results. All functions are available, and the code can be used for serious work, either using the GUI or in batch mode, but the core functions are pre-compiled. They were created using Python version 3.9.16, and require this version or similar to run. Source code including GPU version is available for collaborative work, contact author. PBN Toolkit is based on Theano. A version that runs under Aesara is also provided. requirements: python 3.9 python packages: numpy scipy theano matplotlib (and others) Directory contents: pbntk.pdf User guide files/*.py* PBN Toolkit python program files/models/*.py Network definition files files/*.mat Tutorial data Instructions for installation are given below. Paul May 2022 p.m.baggenstoss@ieee.org ------------------------ The toolkits are based on Theano. Versions that work with Aesara and PyTensor, which are forks of Theano, are available (contact author), but has limited GPU support and are slow. It is best to use Linux, but it also works on Windows. Theano is based on a software model that compiles the source code to a graph or function that once created can be run very quickly. This facilitates starting and stopping training, changing parameters, etc. My Windows test installation (Windows 7) works perfectly, but compiles very slowly (Can take an hour for a function). Once compiled, the code runs fast. I am not sure why this is, but I recommend using Linux. As for Theano, support ended years ago, and Theano does not work with the latest versions of Numpy. However, I have made necessary changes to allow Theano to work with newer Numpy and made it available at http://class-specific.com/theano/theano_1.0.5-pmb.tgz This is just an archive of the theano main directory that you need to link to your python directory. Mine is: ~/miniconda3/lib/python3.9/site-packages/ I provide the following installation guide. Download all the .py and .pyc files into your working directory. These files are compled Python code that run the right version of Python. Make sure you put the model definition files in a sub-folder called 'models'. For source code, please contact me. Installing Theano and CSF or PBN Toolkits on Windows. #----- WINDOWS 7 ------------------ 1. Install Miniconda-3: If you have an older version of Windows, you might need an older version of Miniconda3. Get the code from: http://repo.anaconda.com/miniconda For Windows 7, I had to go back to Miniconda3 version 4.1.2 2. After installing Miniconda3, run the Miniconda-3 Prompt by navigating from the system start menu: System Start Menu -> All Programs -> Anaconda3 -> Anaconda Prompt (Miniconda3) 3. In the Miniconda command window, type: > conda install theano > conda install matplotlib > conda install future > python -m pip install sklearn > python -m pip install playsound > python -m pip install pygame #----- WINDOWS 10 ------------------ Update: a user has reported the following successful installation in Windows 10: 1. Install conda=4.12.0 from the web source reported for Windows 7 2. create a conda environment for the needed python version, since otherwise the magic numbers do not match: conda create -n your_env python=3.9.0 3. Install the following packages into the created environment: conda install numpy scipy theano conda install tk conda install future conda install packaging conda install matplotlib python -m pip install sklearn python -m pip install playsound pip install pygame # --- finshing installation 4. For some reason, installing Theano there is a file missing: "scan_perform.c" I have included this file in the distribution. Go to directory scan_module/ the theano installation directory. For me it was C:/Users/PaulB/Miniconda3/Lib/site-packages/theano/scan_module/ Add a sub-directory called 'c_code' and copy the file scan_perform.c into it. In other words: C:/Users/PaulB/Miniconda3/Lib/site-packages/theano/scan_module/c_code/scan_perform.c 5. In the Miniconda3 command window, run: > set THEANO_FLAGS=mode=FAST_RUN,device=cpu,floatX=float64 You can also specify 'float32' which runs faster. This envoronment variable can also be set permanently using system settings. To run the toolkit: > python pbntk.py It may take a long time to compile functions the first time (took 20 minutes for me). If an error message appears about a missing Python package, try the 'conda' or 'pip' installation as shown above. Environment variables export PBNTK_BACKEND=THEANO export PYTHONPATH=(full path to current directory, or directory where PBN Toolkit resides) export THEANO_FLAGS=mode=FAST_RUN,device=cpu,floatX=float32 or: export THEANO_FLAGS=mode=FAST_RUN,device=cpu,floatX=float64 To start toolkit, run from command line: $$ python pbntk.py Using PMB version of Theano As mentioned above, Theano will not work with latest versions of Numpy. This may cause problems during installation. I The modified version at: http://class-specific.com/theano/theano_1.0.5-pmb.tgz that will work. I am willing to assist with installation problems. Contact me for assistance. p.m.baggenstoss@ieee.org Aug, 2024