Skip to content
Snippets Groups Projects
Commit 1069aa42 authored by Danilo Ferreira de Lima's avatar Danilo Ferreira de Lima
Browse files

Updated all notebooks with the correct emails, some clean up and lots of...

Updated all notebooks with the correct emails, some clean up and lots of details in the README about the Anaconda setup.
parent 66c73356
No related branches found
No related tags found
No related merge requests found
source diff could not be displayed: it is too large. Options to address this: view the blob.
source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -6,16 +6,134 @@ are also given in the notebooks.
Most of the notebooks require installing special software the following is a general setup that should work with most of the given notebooks.
The list of packages needed in each given notebook is given in the beginning of the notebook with a `!pip install ...` command.
It is highly recommended to use Anaconda/Miniconda for the setup, as shown below. If you prefer a simpler configuration, details on the
Virtualenv setup is also given at the end (but this tends to use a less optimized setup, which may affect the performance and some results).
All the data used in the examples are produced on-the-fly for demonstration purposes, or are taken from public and open resources.
None of the data comes from the EuXFEL, as the purpose of the examples is to show the idea behind the methods.
## Anaconda configuration
If you already know how to use Anaconda (or Miniconda), the following
setup is recommended.
If you are not used to Anaconda, see the following references on how to install and a quick start guide:
* https://conda.io/projects/conda/en/latest/user-guide/install/index.html
* https://conda.io/projects/conda/en/latest/user-guide/getting-started.html
Here is a cut-and-paste installation guide for the impatient in Linux:
```
pip install torchvision torch pandas numpy matplotlib ipympl torchbnn scikit-learn
wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh
# or download it from: https://docs.conda.io/en/latest/miniconda.html#linux-installers
bash Miniconda3-py37_4.10.3-Linux-x86_64.sh
# follow the instructions
```
All the data used in the examples are produced on-the-fly for demonstration purposes, or are taken from public and open resources.
None of the data comes from the EuXFEL, as the purpose of the examples is to show the idea behind the methods.
This creates a conda environment named `ml` (use whichever name your prefer instead) and install the packages needed.
If you are using a Mac, please see the section below for a special configuration
for Anaconda in a Mac (due to an incompatibility between some Mac libraries
and Anaconda's default MKL installation).
```
# create the environment
conda create --name ml python=3.6
# activate it
conda activate ml
# install basic libraries
conda install mkl
# PyTorch (without the GPU acceleration):
conda install pytorch torchvision cpuonly -c pytorch
# Or, instead, if you have an NVIDIA GPU (for AMD GPUs, check https://pytorch.org/ and look for the ROCm platform):
#conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
conda install numpy scipy pandas scikit-learn matplotlib jupyter
# for the Bayesian Neural Network notebook:
pip install torchbnn
# play with the notebooks:
jupyter notebook
# when you are done:
conda deactivate
```
### Special Anaconda setup in MacOS
In MacOS, the standard optimization done in Anaconda for fast matrix multiplications using the MKL library clashes with a Mac-specific implementation.
To avoid this issue, use the setup below.
```
# create the environment
conda create --name ml python=3.6
# activate it
conda activate ml
# remove MKL to avoid conflict in MacOS
conda install nomkl
# PyTorch (without the GPU acceleration):
conda install pytorch torchvision cpuonly -c pytorch
# Or, instead, if you have an NVIDIA GPU (will not work with an AMD or Intel GPU):
#conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
conda install numpy scipy pandas scikit-learn matplotlib jupyter
# for the Bayesian Neural Network notebook:
pip install torchbnn
# remove any MKL libraries installed as a dependency from the packages above:
conda remove mkl mkl-service
# play with the notebooks:
jupyter notebook
# when you are done:
conda deactivate
```
More details on this can be found in:
https://stackoverflow.com/questions/53014306/error-15-initializing-libiomp5-dylib-but-found-libiomp5-dylib-already-initial
## Virtualenv setup
It is preferrable to use a virtual environment to avoid any clashes between these
packages and your current setup in your computer. Using a virtual environment,
the setup would be the following (for an environment called `ml`, but use the name
you prefer):
```
# create the environment ml
virtualenv -p python3 ml
# load it
source ml/bin/activate
# install some packages
pip install numpy scipy pandas torch scikit-learn matplotlib torchvision torchbnn jupyter
# play with the notebooks ...
jupyter notebook
# when you are done:
deactivate
```
# Contact us!
### Contact us at the EuXFEL Data Analysis group at any time if you need help analysing your data!
#### Contact us at the EuXFEL Data Analysis group at any time if you need help analysing your data!
#### Danilo Ferreira de Lima: danilo.enoque.ferreira.de.lima@xfel.eu
#### Arman Davtyan: arman.davtyan@xfel.eu
#### Email: da@xfel.eu
source diff could not be displayed: it is too large. Options to address this: view the blob.
source diff could not be displayed: it is too large. Options to address this: view the blob.
source diff could not be displayed: it is too large. Options to address this: view the blob.
source diff could not be displayed: it is too large. Options to address this: view the blob.
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment