<commit_before>Anaconda and Jupyter Notes
==========================

Installation
------------

Download Conda distribution from
https://www.anaconda.com/distribution/ and run the interactive installer.

Basics
------

To create a blank Conda envirnoment called "env1" for Python 3.6::

    conda create -n env1 python=3.6 pip

To dump current environment into a Conda YAML config (this is Conda equivalent of "pip freeze")::

    conda env export > environment.yml

To create a Conda environment from a Conda YAML config::

    conda env create -f environment.yml

To view all environments::

    conda env list

To switch between environments::

    conda activate <environment-name>
    conda deactivate

To delete an existing environment::

    conda env remove --name <environment-name>

To clean up an active conda environment (this reduces disk space usage)::

    conda clean --all

Tensorflow v2 environment with Conda
------------------------------------

Create a new conda environment::

    conda create -n tf2 python=3.6 pip
    conda activate tf2
    conda install setuptools
    conda install -c pytorch cuda100 cudatoolkit cudnn numba pytorch torchvision ignite
    conda install cython matplotlib seaborn pillow scikit-learn pandas  \
        tqdm pylint pyyaml statsmodels joblib pytest pydot dill \
        pytables numpy scipy joblib psutil colorama
    conda install -c conda-forge imbalanced-learn scikit-garden mlxtend xgboost tensorboard \
        tensorboardx visdom lightgbm frozendict boto3 jupyter_contrib_nbextensions fastparquet \
        pyaml frozendict s3fs boto3 awscli ipython ipykernel nodejs ipywidgets nbstripout jupyter \
        jupyterlab jupyter_contrib_nbextensions

Finally install Tensorflow 2.0::

    conda install tensorflow-gpu

Note: previously (TF-2.0 beta( one had to use pip: ``pip install tensorflow-gpu==2.0.0-beta1``.

Test whether GPU is available::

    python3
    >>> import tensorflow as tf
    >>> tf.test.is_gpu_available()<commit_msg>Update conda.rst<commit_after>Anaconda and Jupyter Notes
==========================

Installation
------------

Download Conda distribution from
https://www.anaconda.com/distribution/ and run the interactive installer.

Basics
------

To create a blank Conda envirnoment called "env1" for Python 3.6::

    conda create -n env1 python=3.6 pip

To dump current environment into a Conda YAML config (this is Conda equivalent of "pip freeze")::

    conda env export > environment.yml

To create a Conda environment from a Conda YAML config::

    conda env create -f environment.yml

To view all environments::

    conda env list

To switch between environments::

    conda activate <environment-name>
    conda deactivate

To delete an existing environment::

    conda env remove --name <environment-name>

To clean up an active conda environment (this reduces disk space usage)::

    conda clean --all

Tensorflow v2 environment with Conda
------------------------------------

Create a new conda environment::

    conda create -n tf2 python=3.6 pip
    conda activate tf2
    conda install setuptools
    conda install -c pytorch cuda100 cudatoolkit cudnn numba pytorch torchvision ignite
    conda install cython matplotlib seaborn pillow scikit-learn pandas  \
        pylint pyyaml statsmodels joblib pytest pydot dill \
        pytables numpy scipy joblib psutil colorama
    conda install -c conda-forge imbalanced-learn scikit-garden mlxtend xgboost tensorboard \
        tqdm tensorboardx visdom lightgbm frozendict boto3 jupyter_contrib_nbextensions fastparquet \
        pyaml frozendict s3fs boto3 awscli ipython ipykernel nodejs ipywidgets nbstripout jupyter \
        jupyterlab jupyter_contrib_nbextensions

Finally install Tensorflow 2.0::

    conda install tensorflow-gpu

Note: previously (TF-2.0 beta( one had to use pip: ``pip install tensorflow-gpu==2.0.0-beta1``.

Test whether GPU is available::

    python3
    >>> import tensorflow as tf
    >>> tf.test.is_gpu_available()
{'fraction_non_alphanumeric': 0.09018236322757932, 'fraction_numerical': 0.012990257307019736, 'mean_word_length': 3.255047821466525, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '604351', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1177, 'n_words': 446}