Example scripts for running deep neural networks using Keras and TensorFlow2 in Python and R.
Example files are located in: /home/bcbb_teaching_files/intro_deep_learning/
NOTE: I suggest you either clone this GitHub repo or copy the HPC files to a folder in your local home directory! Please do not modify the python scripts in the course directory above. Normally, you would want to create your own conda environment with the specific packages you need for your own work - for those using the HPC for the class we will use a shared environment so we cut down on the number of redundant file copies.
which conda
/biocompace/condabin/conda init bash
(now log out and back in again and hopefully conda
should be available to you)
conda activate /home/bcbb_teaching_files/intro_deep_learning/envs
source /home/bcbb_teaching_files/intro_deep_learning/envs/bin/activate
Hopefully, if things work, this should make Tensorflow v2.1.0 and other libraries available to you to run the examples. You should see the folder path appear at the start of your terminal. Test by running:
python /home/bcbb_teaching_files/intro_deep_learning/1_keras_hello_world.py
and you should see a small model start to train and predict.
To run these you'll need python and the following packages installed. :
- numpy
- scikit-learn
- h5py
- Pillow
- matplotlib
- tensorflow (v2 now includes keras)
I recommend installing packages using a virtual environment. On a Linux machine, pip
should work for the above packages but if you have Anaconda installed, you can easily use the deep_learning_environment.yml
file to make a deep_learning
environment via the command:
conda env create -f deep_learning_environment.yml
.
You can install to a specific directory with a custom name for the environment using: conda env create --prefix ./envs -n myname -f deep_learning_environment.yml
where ./envs
is the directory you want to install to and myname
is the name you want to call the environment.
Note For Mac Users! - If you run into problems with the scripts crashing, you might also need to also install the nomkl
package to prevent a multithreading bug in numpy
.