- Mac version: 10.11.3
- Python version: 3.5.1
$ brew tap homebrew/versions
$ brew install llvm37
""" 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 |
import numpy as np | |
''' | |
------------------------------------------------ | |
Use dynamic programming (DP) to solve 0/1 knapsack problem | |
Time complexity: O(nW), where n is number of items and W is capacity | |
------------------------------------------------ | |
knapsack_dp(values,weights,n_items,capacity,return_all=False) | |
Input arguments: |
In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.