Commit 596303ce authored by Ashish Gaurav's avatar Ashish Gaurav

update doc, scripts (from bitbucket)

parent ae9f7219
......@@ -4,35 +4,39 @@ Requirements
============
* Python 3.6
* `requirements.txt <../requirements.txt>`_ for package list.
* Sphinx
* Please check `requirements.txt` for python package list.
Installation
============
* Run the install script: :code:`scripts/install.sh`
* Run the install dependencies script: `./scripts/install_dependencies.sh` to install pip3 and required python packages.
Note: The script checks if dependencies folder exists in the project root folder. If it does, it will install from the local packages in that folder,
else will install required packages from the internet. If you do not have an internet connection and the dependencies folder does not exist,
you will need to run `./scripts/download_dependencies.sh` using a machine with an internet connection first and transfer that folder.
Documentation
=============
* For documentation, we use *Sphinx*
* If `install.sh` was run, use :code:`scripts/generate_doc.sh launch` to view documentation or open `index.html <./documentation/index.html>`_ .
* If not, use :code:`scripts/generate_doc.sh build` to generate documentation first.
* Open `./documentation/index.html` to view the documentation
* If the file does not exist, use command `./scripts/generate_doc.sh build` to generate documentation first. Note that this requires Sphinx to be installed.
Replicate Results
=================
These are the minimum steps required to replicate the results for simple_intersection environment. For a detailed user guide, it is recommended to view the documentation.
* Run `scripts/install.sh`
* Run `./scripts/install_dependencies.sh` to install python dependencies.
* Low-level policies:
* To train all low-level policies from scratch: `python low_level_policy_main.py --train`
* To train a single low-level, for example wait: `python low_level_policy_main.py --option=wait --train`
* To test these trained low-level policies: `python low_level_policy_main.py --test --saved_policy_in_root`
* To test one of these trained low-level policies, for example wait: `python low_level_policy_main.py --option=wait --test --saved_policy_in_root`
* To train all low-level policies from scratch: `python3 low_level_policy_main.py --train`
* To train a single low-level, for example wait: `python3 low_level_policy_main.py --option=wait --train`
* To test these trained low-level policies: `python3 low_level_policy_main.py --test --saved_policy_in_root`
* To test one of these trained low-level policies, for example wait: `python3 low_level_policy_main.py --option=wait --test --saved_policy_in_root`
* High-level policy:
* To train high-level policy from scratch using the given low-level policies: `python high_level_policy_main.py --train`
* To evaluate this trained high-level policy: `python high_level_policy_main.py --evaluate --saved_policy_in_root`
* To run MCTS using the high-level policy: `python mcts.py`
* To train high-level policy from scratch using the given low-level policies: `python3 high_level_policy_main.py --train`
* To evaluate this trained high-level policy: `python3 high_level_policy_main.py --evaluate --saved_policy_in_root`
* To run MCTS using the high-level policy: `python3 mcts.py`
Coding Standards
================
......@@ -42,7 +46,7 @@ It is not necessary to keep these in mind while coding, but before
submitting a pull request, do these two steps for each python file you
have modified.
1. :code:`yapf -i YOUR_MODIFIED_FILE.py`
2. :code:`docformatter --in-place YOUR_MODIFIED_FILE.py`
1. `yapf -i YOUR_MODIFIED_FILE.py`
2. `docformatter --in-place YOUR_MODIFIED_FILE.py`
:code:`yapf` formats the code and :code:`docformatter` formats the docstrings.
\ No newline at end of file
`yapf` formats the code and `docformatter` formats the docstrings.
\ No newline at end of file
setuptools==39.2.0
wheel==0.31.1
numpy==1.14.3
pyglet==1.3.2
Sphinx==1.7.8
yapf==0.23.0
docformatter==1.0
recommonmark==0.4.0
tensorflow==1.8.0
keras-rl==0.4.2
h5py==2.8.0
gym==0.10.5
stable_baselines==2.1.1
tqdm==4.23.4
\ No newline at end of file
#!/bin/bash
# files are to be relative from scripts directory
DEPENDENCY_DIRECTORY="../dependencies"
PIP_PACKAGE_FOLDER="$DEPENDENCY_DIRECTORY/pip_packages"
PIP_SETUP_FOLDER="$DEPENDENCY_DIRECTORY/pip"
PIP_FILE_NAME="pip-18.1"
DEB_PACKAGE_FOLDER="$DEPENDENCY_DIRECTORY/deb"
REQUIREMENTS_FILE="../requirements.txt"
PIP_LINK="https://files.pythonhosted.org/packages/45/ae/8a0ad77defb7cc903f09e551d88b443304a9bd6e6f124e75c0fbbf6de8f7/pip-18.1.tar.gz"
\ No newline at end of file
# DEB links
DEB_LINKS=("http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python3-pip_9.0.1-2_all.deb" \
"http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip-whl_9.0.1-2_all.deb" \
"https://launchpadlibrarian.net/363338860/python3-lib2to3_3.6.5-3_all.deb" \
"https://launchpadlibrarian.net/363338856/python3-distutils_3.6.5-3_all.deb")
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source dependencies_config.sh
source "$SCRIPT_DIR/dependencies_config.sh"
# Create folders
mkdir $DEPENDENCY_DIRECTORY
mkdir $PIP_SETUP_FOLDER
mkdir $PIP_PACKAGE_FOLDER
mkdir $SCRIPT_DIR/$DEPENDENCY_DIRECTORY
mkdir $SCRIPT_DIR/$DEB_PACKAGE_FOLDER
mkdir $SCRIPT_DIR/$PIP_PACKAGE_FOLDER
# Download pip
wget -P $PIP_SETUP_FOLDER $PIP_LINK
# Download debs
for LINK in "${DEB_LINKS[@]}"
do
:
wget -P $SCRIPT_DIR/$DEB_PACKAGE_FOLDER "$LINK"
done
# Download pip packeges using requirements file
pip download -r $REQUIREMENTS_FILE -d $PIP_PACKAGE_FOLDER
\ No newline at end of file
pip download -r $SCRIPT_DIR/$REQUIREMENTS_FILE -d $SCRIPT_DIR/$PIP_PACKAGE_FOLDER
\ No newline at end of file
#!/bin/bash
sh ./install_dependencies.sh
sh ./generate_doc.sh clean
sh ./generate_doc.sh build
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source $SCRIPT_DIR/dependencies_config.sh
source dependencies_config.sh
cd $SCRIPT_DIR
# Install pip
if ! [ -x "$(command -v pip3)" ]; then
echo "Installing pip3..."
if [ -d "$DEPENDENCY_DIRECTORY" ]; then
tar -xvzf "$PIP_SETUP_FOLDER/$PIP_FILE_NAME.tar.gz"
python3 "./$PIP_FILE_NAME/setup.py" install
rm -rf "./$PIP_FILE_NAME"
else
sudo apt-get update
sudo apt-get install python3-pip
fi
# Install python3-pip
echo "Installing python3-pip and dependant packages..."
DEB_LIST=""
if [ -d "$DEPENDENCY_DIRECTORY" ]; then
cd $DEB_PACKAGE_FOLDER
for filename in *.deb; do
DEB_LIST+="$filename "
done
sudo dpkg -i $DEB_LIST
cd $SCRIPT_DIR
else
sudo apt-get update
sudo apt-get install python3-pip
fi
# Install packages in requirements.txt
if [ -d "$DEPENDENCY_DIRECTORY" ]; then
pip3 install --no-index --find-links=$PIP_PACKAGE_FOLDER -r $REQUIREMENTS_FILE --user
pip3 install --no-index --find-links=$PIP_PACKAGE_FOLDER setuptools
pip3 install --no-index --find-links=$PIP_PACKAGE_FOLDER wheel
pip3 install --no-index --find-links=$PIP_PACKAGE_FOLDER -r $REQUIREMENTS_FILE
else
pip3 install -r $REQUIREMENTS_FILE --user
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment