Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
famura committed Jul 14, 2020
1 parent 096dd52 commit 73d2a5a
Show file tree
Hide file tree
Showing 620 changed files with 108,116 additions and 25 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/__pycache__*
**/.idea
**/build
Pyrado/data
Dockerfile
setup_docker.sh
38 changes: 38 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Docker Image CI

on:
push:
branches: [ master, cicd ]
pull_request:
branches: [ master, cicd ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile --tag simurlacra
- name: Execute tests
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
run: |
wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
export COVPATH=$(realpath .)
chmod +x test-reporter-latest-linux-amd64
./test-reporter-latest-linux-amd64 before-build
docker run --rm -i -v $COVPATH:/cov simurlacra conda run -n pyrado bash -c "pytest Pyrado/tests --cov=./Pyrado --cov-report=xml --verbose -m 'not visualization and not longtime'; sudo cp ./coverage.xml /cov"
sudo mkdir /home/user/
sudo mkdir /home/user/SimuRLacra
sudo ln -s $COVPATH /home/user/SimuRLacra
./test-reporter-latest-linux-amd64 format-coverage coverage.xml -t coverage.py -p /home/user/SimuRLacra
./test-reporter-latest-linux-amd64 upload-coverage
- uses: codecov/codecov-action@v1
with:
file: coverage.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true
20 changes: 20 additions & 0 deletions .github/workflows/publish_docker_hub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish Docker image
on:
release:
types: [published]
push:
branches: [ master, cicd ]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: simurlacra/simurlacra
tag_with_ref: true
77 changes: 77 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the Fabio Muratore, Honda Research Institute Europe GmbH,
# or Technical University of Darmstadt. nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL FABIO MURATORE, HONDA RESEARCH INSTITUTE EUROPE GMBH,
# OR TECHNICAL UNIVERSITY DAMRSTADT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

FROM nvidia/cuda:10.1-base-ubuntu18.04

ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
curl ca-certificates sudo git bzip2 libx11-6 \
gcc g++ make cmake zlib1g-dev swig libsm6 libxext6 \
build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
wget llvm libncurses5-dev xz-utils tk-dev libxrender1\
libxml2-dev libxmlsec1-dev libffi-dev libcairo2-dev libjpeg-dev libgif-dev chromium-browser

RUN adduser --disabled-password --gecos '' --shell /bin/bash user && chown -R user:user /home/user
RUN echo 'user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/90-pyrado
USER user
WORKDIR /home/user

RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm Miniconda3-latest-Linux-x86_64.sh

ENV PATH /home/user/miniconda3/bin:$PATH

RUN conda update conda \
&& conda update --all

COPY --chown=user:user . SimuRLacra

WORKDIR /home/user/SimuRLacra
RUN bash setup_env.sh
SHELL ["conda", "run", "-n", "pyrado", "/bin/bash", "-c"]

RUN echo "export PATH=/home/user/miniconda3/bin:$PATH" >> ~/.bashrc
RUN echo "conda activate pyrado" >> ~/.bashrc

RUN python setup_deps.py dep_libraries -j4
#RUN python setup_deps.py all --use-cuda -j4

#RUN conda install pytorch torchvision
RUN conda install pytorch cudatoolkit=10.1 -c pytorch

RUN python setup_deps.py separate_pytorch -j4
RUN python setup_deps.py pytorch_based -j4
ENV PATH /opt/conda/envs/pyrado/bin:$PATH
ENV PYTHONPATH /home/user/SimuRLacra/RcsPySim/build/lib:/home/user/SimuRLacra/Pyrado/:$PYTHONPATH
ENV RCSVIEWER_SIMPLEGRAPHICS 1
RUN sudo rm -rf /var/lib/apt/lists/*
Empty file added Pyrado/CMakeLists.txt
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
env:
fixed_initial_state: false
max_steps: 1500
seed: None
policy:
dim_mask: 2
rbf_hparam:
bounds: !!python/tuple
- 0.0
- 1.0
num_feat_per_dim: 6
scale: None
algo:
expl_std_init: 0.3
expl_std_min: 0.01
extra_expl_decay_iter: 3
extra_expl_std_init: 0.3
max_iter: 10
num_is_samples: 5
num_rollouts: 5
num_sampler_envs: 8
pop_size: 100
algo_name: cem
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
iteration,curr policy return,max return,median return,avg return,std return,avg rollout len,min mag policy param,max mag policy param,median imp samp return,min imp samp return,min expl strat std,avg expl strat std,max expl strat std,expl strat entropy
0,-8.710662412873106,760.0009674816167,-59.49109091927956,-54.75214796469511,161.70942654960675,1454.1742574257426,-0.06588651703635981,0.9594797017748344,254.09926481440442,197.45186031794333,0.4952320663210924,0.6740265907538588,0.9926125539900024,-1.2462299865117759
1,142.9067609565233,541.4432401163832,-35.41420913162493,-54.41402173803204,198.31093852441822,1056.4019801980198,0.028735621976779157,0.659794569762903,365.2500586127184,215.082042587284,0.4800436618741938,0.6996407588327149,1.018251459540245,-0.9231380338674846
2,26.08922252016557,488.0381192165846,-10.618967937350027,-64.6238376113633,221.2182947981403,1148.110891089109,-0.1353694016491672,0.8352587767568821,277.2010287800021,222.88229230239176,0.34129310443874794,0.5592734015956519,0.7267108513350384,-2.231934706655034
3,142.78333728731837,615.8282986546582,-8.751857440182793,-15.873068953842044,169.89118164223183,1317.918811881188,0.07078493691725676,0.6299086176047138,342.9185866063518,236.08888376576806,0.3026654464641786,0.347306753251194,0.40874946127083484,-4.958370737214771
4,526.2311810162637,1381.008954084298,33.62058877814255,119.71127293017896,280.8111973711075,1270.1683168316831,0.013518243963281284,1.0958515155246578,817.7914025855504,674.3256381149829,0.19462435684886153,0.31779845312787885,0.42765265367643823,-5.683563109152338
5,1030.6007983936624,1503.52900454265,54.482756066416734,134.1965640344503,302.27627122916215,1262.0950495049506,-0.04331775457789238,1.2476513418814947,1087.5830003662575,677.0875910317316,0.11401600363224819,0.2055208597840044,0.2871375059982868,-8.482765299354769
6,1036.5707037069046,1080.1495026744374,142.50981400470496,257.770124646996,300.0721407575729,1311.3722772277229,-0.05323266176464527,1.2440819700359107,1036.5707037069046,836.2666470146954,0.12306302638322535,0.19995654133601218,0.44312435939109734,-8.934397363815823
7,1372.1527449006005,1468.4834040530375,319.41293220853925,351.49493635854265,367.647850404073,1339.70099009901,-0.02060456524553212,1.2147972792939679,1380.287130870913,1353.5553103693815,0.043445394961782485,0.1479220675713729,0.38705008846936084,-11.804067570846986
8,1190.6823499484422,1554.9531478915023,442.09111042608276,498.9841182235761,362.36674100186576,1405.9623762376239,0.07134620765620289,1.2265204543711241,1373.3864119939967,1192.885666625422,0.04113023930981834,0.08674639252748194,0.14328866679493457,-13.760231277175372
9,1208.1312553685761,1503.8858949526261,671.1936789766326,740.8832172879393,337.9060063313051,1460.7821782178219,0.015087683321546608,1.2758841315893692,1366.5288590416953,1355.1885024051735,0.018076026431905142,0.05416133713740234,0.09643366296125244,-17.166969482632815
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Pyrado/data/perma/time_series/omo_traj_gt.npy
Binary file not shown.
Binary file added Pyrado/data/perma/time_series/omo_traj_n.npy
Binary file not shown.
Empty file.
104 changes: 104 additions & 0 deletions Pyrado/doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of Fabio Muratore, Honda Research Institute Europe GmbH,
# or Technical University of Darmstadt, nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL FABIO MURATORE, HONDA RESEARCH INSTITUTE EUROPE GMBH,
# OR TECHNICAL UNIVERSITY OF DARMSTADT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

# Configuration file for the Sphinx documentation builder.
# This file only contains a selection of the most common options. For a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# ----------
# Path setup
# ----------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

from pyrado import VERSION


# Add packages to the path
sys.path.insert(0, os.path.abspath('..')) # doc folder
sys.path.insert(0, os.path.abspath('../..')) # Pyrado folder

# -------------------
# Project information
# -------------------
project = 'Pyrado'
version = '.'.join(VERSION.split('.')) # short version
release = VERSION # full version including tags
copyright = '2020'
author = 'Fabio Muratore & Felix Treede & Robin Menzenbach & Chrisitan Eilers'

# ---------------------
# General configuration
# ---------------------
# Add any Sphinx extension module names here, as strings
# They can be extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones
extensions = [
'sphinx.ext.inheritance_diagram',
'sphinx.ext.autosectionlabel',
'sphinx_math_dollar',
'sphinx.ext.mathjax',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]

# Add any paths that contain templates here, relative to this directory
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and dirs to ignore when looking for source files
# This pattern also affects html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use
pygments_style = 'sphinx'

source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'restructuredtext',
'.md': 'markdown',
}

# The master toctree document
master_doc = 'index'

# -----------------------
# Options for HTML output
# -----------------------
# The theme to use for HTML and HTML Help pages. See the documentation for a list of builtin themes
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here, relative to this directory.
# They are copied after the builtin static files, so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

add_module_names = False
Loading

0 comments on commit 73d2a5a

Please sign in to comment.