Giter VIP home page Giter VIP logo

jaykamat99 / optimization-course Goto Github PK

View Code? Open in Web Editor NEW

This project forked from marctoussaint/optimization-course

0.0 0.0 0.0 122 KB

Python bindings to some optimization benchmarks (robotics problems), in order to constrained optimization solvers. Includes also an interface to the solvers within rai. See the jupyter notebocks in 'tutorials'.

License: MIT License

CMake 14.73% Jupyter Notebook 77.36% Makefile 7.91%

optimization-course's Introduction

Optimization Algorithms course

This repo is based on the RAI code, including its python bindings. See https://github.com/MarcToussaint/rai for a README of the RAI code.

Compile directly on Ubuntu

This assumes a standard Ubuntu 20.04 machine.

  • The following assumes $HOME/git as your git path, and $HOME/opt to install 3rd-party libs -- please stick to this (no system-wide installs)

  • Install basics

sudo apt-get update
sudo apt-get install git sudo build-essential cmake
  • Clone the repo, install Ubuntu packages, & compile with cmake:
mkdir -p $HOME/git
cd $HOME/git
git clone https://github.com/MarcToussaint/optimization-course.git
cd optimization-course

git submodule init
git submodule update

make -j1 printUbuntuAll    # for your information: what the next step will install
make -j1 installUbuntuAll  # calls sudo apt-get install; you can always interrupt

mkdir build
cd build
cmake ..
make -j $(command nproc)
  • Install python packages:
pip3 install --user pybind11 jupyter matplotlib
  • Test
cd $HOME/git/optimization-course
jupyter-notebook tutorials/how_to_query_an_NLP.ipynb
  • When pulling updates for the repo, don't forget to also update the submodules:
git pull
git submodule update

Use Docker on Ubuntu

  • Install docker engine for Ubuntu as described here, namely:
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
  • Add your user to the docker user group (otherwise use sudo in front of all docker commands below)
sudo usermod -aG docker ${USER}

Log out and in again!

docker pull marctoussaint/rai-optim20
  • Run the docker, mounting your $HOME directory as ~/home
xhost +local:root
docker run -it \
       --volume="$HOME/:/root/home" \
       --env="DISPLAY" \
       --network host \
       --device /dev/input \
       rai-optim20 /bin/bash
  • When running the docker you should get a *** Welcome *** message. You can now run the jupyter server within the docker:
jupyter-notebook optimization-course/tutorials --ip 0.0.0.0 --no-browser --allow-root &

This starts a jupyter server without browser. You can now open your normal Ubuntu browser and access the Jupyter server at http://localhost:8888/?token=... as displayed on the console.

  • Whenever you close the docker, the jupyter server and local changes in optimization-course/tutorials get lost. To prevent this, create notbooks in your ~/home directory, which mounts your actual Ubuntu $HOME. (Or mount other paths, as you like.)

  • Side note: This is how the docker was created

Compile on Windows within Ubuntu WSL

  • From the Microsoft Store, install the 'Ubuntu 20.04 LTS' (which I think is a WSL Ubuntu)

  • When you launch it, you get some error on 'component is not enabled'. Follow the https://aka.ms/wslinstall instructions (including reboot)

  • Launch the ubuntu

  • Install basics

sudo apt-get update
sudo apt-get install git sudo build-essential cmake libjsoncpp-dev --fix-missing
  • Follow the 'Compile directly on Ubuntu' instructions

  • When launching jupyter, use --no-browser and direct your browser to the link displayed

  • Installing X - I wasn't successful

Use Docker on Windows

  • Install Docker Desktop for Windows

  • In a console, pull and run the docker:

docker pull marctoussaint/rai-optim20
docker run -it -p 8888:8888 marctoussaint/rai-optim20 /bin/bash
  • Within the docker run jupyter
jupyter-notebook optimization-course/tutorials --ip 0.0.0.0 --allow-root

optimization-course's People

Contributors

marctoussaint avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.