- Installation
- Install requirements
Using conda as an environment and package manager is optional. Using pip as a package manager and pipenv/virtualenv/etc. as Python environment managers is a valid option too.
However, we recommend to prioritize using conda over pip, because it allows managing not only python packages, as pip does, and also resolves package dependencies smarter, ensuring that the environment has no version conflicts (see understanding pip and conda for details). Having said that, we recommend trying to install as much packages as you can with conda first, and use pip only as the last resort (sadly, not every requirement is available in conda channels).
If you are new to conda, we recommend getting conda with Miniconda instead of Anaconda, because it's just a minimal console version of the conda tool (see the difference).
If you feel confident, you may also consider Miniforge as an alternative to Miniconda — the difference is only that it sets the default conda package channel to conda-forge, which is community-driven, so it gets updates faster in general and contains more packages. Another alternative - now to conda itself - is to use Mamba. Mamba mimics conda API, even uses it and fully backward compatible with it, so you can use both together; Mamba has enhanced dependency-resolving performance and async package installation, and also extends conda functionality. Last two options combined, Mamba + Miniforge = Mambaforge, are distributed by Miniforge community.
To setup Git LFS you need to install git-lfs
first:
# Linux:
apt install git-lfs
# Mac:
brew install git-lfs
Then "link" git and git-lfs together by:
# system-wise
git lfs install --system
# or only for the repository you're in
git lfs install
After this you just work as usual.
Check out .gitattributes
for the project's git-lfs rules. To print all tracked files use git lfs ls-files
.
Storing binary or any other "data" files in a repository can quickly bloat its size. They rarely change, and if so, mostly as a whole file (i.e they are added or deleted, not edited). But git still treats them as text files and tries to track their content, putting it to the index.
If only was a way to track some signature of these files, store their content somewhere else and pull them only on demand! Fortunately, that's exactly what Git[hub] LFS do :) It stands for Large File Storage. Here's the quote from Git LFS site:
Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.
File requirements.txt
contains all required dependencies. Also, as commented in requirements.txt
, you will need to install four additional dependencies:
- Our fork of the
htm.core
package. - [optional] CoppeliaSim + PyRep
- [optional] AnimalAI
- [optional] Pinball
In this section we provide you with two options: a) install requirements using both conda and pip or b) install everything with pip. In both cases everything is installed into the dedicated conda environment. The name of the environment is up to you, while we use hima
for this guide.
Create new conda environment with all requirements that can be installed with conda; then install what's left with pip:
conda create --name hima python=3.9 numpy matplotlib jupyterlab ruamel.yaml tqdm wandb mock imageio seaborn pygraphviz colormap prettytable pytest
conda activate hima
pip install hexy
Create new conda environment and install everything with pip:
conda create --name hima python=3.9
conda activate hima
pip install -r requirements.txt
In our research we use a slightly modified version of the htm.core
package, thus you have to install our fork instead of the origin. The following script installs it from the sources:
cd <where to fork>
git clone https://github.com/ZhekaHauska/htm.core.git
cd htm.core
pip install .
If you are planning to run experiments with arm manipulators, you should also install PyRep.
If you are planning to run experiments in AnimalAI environment, you should also install it.
Install our hima
package:
cd <hima_project_root>
pip install -e .
The last command installs hima
with the "development mode" flag. It allows you importing modules from the hima
package outside of the package root folder, e.g. in Jupyter Notebooks or in another projects. Development mode flag -e
prevents the package sources to be copied to the package index. Instead, the symlink is created, which means that the edits are "visible" immediately and don't require you to reinstall/update the package manually after any changes in its sources.
If you are planning to run experiments in Pinball environment, you should also install it.
hima/
- the package sourcesexperiments/scirpts/run_agent.py
- runner, i.e. entry point to run testing scenarios.