Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/SOF-4277 - TensorMol and TensorFlow Docs #183

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions lang/en/docs/tutorials/python-packages/tensorflow-cpu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# TensorFlow
[TensorFlow](https://www.tensorflow.org/) is a powerful open-source machine learning platform geared towards neural networks.

## Installation Instructions

Although we do not yet have a module file available to run TensorFlow, it can easily be installed to your user environment.

### Selecting Versions for Python and TensorFlow

Keep in mind that TensorFlow's development is rapidly evolving, and thus its dependencies can suddenly change in new versions.
We recommend checking the [official TensorFlow documentation](https://www.tensorflow.org/install/pip) to verify that the
version of Python and version of TensorFlow selected are compatible with one-another. Further notes:

* [TensorFlow versions 1.X](https://pypi.org/project/tensorflow/1.15.5/)
are only compatible with Python releases earlier than Python 3.7.
* Python 3.8 is only supported by [TensorFlow versions 2.2](https://www.tensorflow.org/install/pip) and later.

### Creating a Virtual Environment

To maximize predictibility and control over the python environment,
we recommend using [PyEnv](/cli/actions/customize/#via-pyenv) to set up a Python virtual environment containing
the desired version of Python.

### Installing TensorFlow

Once the desired version of Python has been installed, and its virtual environment has been activated, TensorFlow can
be installed via pip:

```bash
python -m pip install tensorflow --no-cache-dir
```

Or, if a specific version of TensorFlow is desired (for example, version `2.4.1`):

```bash
python -m pip install "tensorflow==2.4.1" --no-cache-dir
```

On other occasions, versions which satisfy the condition of "Latest, but no later than version X" are desireable, such
as in the case of [TensorMol](/software-directory/machine-learning/tensormol), which is incompatible with TensorFlow v2. This can be accomplished easily:

```bash
python -m pip install "tensorflow<2.0" --no-cache-dir
```
60 changes: 60 additions & 0 deletions lang/en/docs/tutorials/python-packages/tensormol-cpu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# TensorMol

[TensorMol](https://github.com/jparkhill/TensorMol) is a machine learning toolkit geared towards materials science and
chemistry.

## Installation

Although we do not currently support workflows of TensorMol in the web UI, TensorMol can be easily installed to the
command line interface.

### Selecting a Version of Python and TensorFlow

TensorMol requires that the version of [TensorFlow](./tensorflow) used be released no later than v1. In other words,
TensorFlow versions starting with 1 (such as version `1.15.5`) will be compatible, but TensorFlow versions beginning
with 2 (such as `2.0.0` or `2.4.1`) will not be compatible with TensorMol.

[Whichever version](https://pypi.org/project/tensorflow/#history) of TensorFlow is installed, we recommend checking that
it is compatible with the desired version of Python. Mind, TensorFlow v1 does not support Python 3.8. In this guide, we
will focus on installing **Python 3.6.12** and the **TensorFlow 1.15.5**.

### Creating a Python Environment

TensorMol depends on specific versions of TensorFlow, which in turn requires specific versionf of Python. For this
reason, we recommend using [PyEnv](/cli/actions/customize/#via-pyenv) to install Python 3.6.12, along with a virtual
environment to store the required packages.

### Installing TensorMol's Dependencies

TensorFlow version 1.15.5 can then be installed via Pip:

```bash
python -m pip install "tensorflow<2.0" --no-cache-dir
```


Next, SciPy must be installed as a prerequisite:

```bash
python -m pip install scipy --no-cache-dir
```

### Downloading and Building TensorMol

TensorMol must be acquired from its [GitHub repository](https://github.com/jparkhill/TensorMol). We recommend creating
a `repos` directory on one of the cluster nodes, such as the [AWS cluster](/infrastructure/cluster/aws/#cluster),
cluster-001, as the clusters have more disk space than the login node:

```bash
cd ~/cluster-001
mkdir repos
git clone https://github.com/jparkhill/TensorMol.git
```
Once the repository is cloned, TensorMol can then be installed by going into its directory, and pip installing it. For
example, if TensorMol had been cloned into `~/cluster-001/repos/TensorMol`, the following commands would complete its
installation:

```bash
cd ~/cluster-001/repos/TensorMol
pip install -e .
```
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ nav:
- Interpolated Sets: tutorials/materials/interpolated-sets.md
- Molecule on a Surface: tutorials/materials/molecule-surface.md
- Interface: tutorials/materials/slabs-interface.md
- Python Packages:
- TensorFlow (CPU): tutorials/python-packages/tensorflow-cpu.md
- TensorMol (CPU): tutorials/python-packages/tensormol-cpu.md


# COMMON UI COMPONENTS
Expand Down