sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
make
make check
sudo make install
sudo ldconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# importing copy as we have to copy the same image to different instances to visualize | |
import copy | |
plt.rcParams['figure.figsize'] = [14.0, 7.0] | |
# Set the parameters of the ORB algorithm by specifying the maximum number of keypoints to locate and | |
# the pyramid decimation ratio | |
orb = cv2.ORB_create(200, 2.0) # refer the opencv page for available arguments and usages | |
# computing the keypoints using the detectandcompute method, this accepts a grey scale image and None parameter | |
# is to let the ORB know we are not using any mask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Classic cart-pole system. | |
Pymunk version by Ian Danforth | |
""" | |
import math | |
import gym | |
import pygame | |
import pymunk |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyglet | |
import pyglet.gl as gl | |
import numpy as np | |
import os | |
import tempfile | |
import subprocess | |
import collections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
import numpy as np | |
import cPickle as pickle | |
import gym | |
# hyperparameters | |
H = 200 # number of hidden layer neurons | |
batch_size = 10 # every how many episodes to do a param update? | |
learning_rate = 1e-4 | |
gamma = 0.99 # discount factor for reward |