This file contains hidden or 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
| #ifdef SHELL | |
| g++ -Wall -Werror -g -I../../cclib/rapidjson/include $0 && ./a.out | |
| exit 0 | |
| #endif | |
| // Output is: | |
| // {"project":"rapidjson","stars":11} | |
| // {"Name":"XYZ","Rollnumer":2,"array":["hello","world"],"Marks":{"Math":"50","Science":"70","English":"50","Social Science":"70"}} | |
| // {"FromEmail":"sender@gmail.com","FromName":"Sender's name","Subject":"My subject","Recipients":[{"Email":"recipient@gmail.com"}],"Text-part":"this is my text"} |
This file contains hidden or 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 |
This file contains hidden or 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
| #!/usr/bin/env python2 | |
| import os | |
| import gym | |
| import sys | |
| import random | |
| import itertools | |
| from time import time | |
| from copy import copy | |
| from math import sqrt, log |
This file contains hidden or 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
| # ---------------------------------------------------- | |
| # 1: NVIDIA Graphics Driver Installation | |
| # ---------------------------------------------------- | |
| sudo add-apt-repository ppa:graphics-drivers/ppa | |
| sudo apt-update | |
| sudo apt install nvidia-384 nvidia-384-dev | |
| # ---------------------------------------------------- | |
| # 2: Blacklist noveau-graphics-driver |
This file contains hidden or 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
| """ | |
| solving pendulum using actor-critic model | |
| """ | |
| import gym | |
| import numpy as np | |
| from keras.models import Sequential, Model | |
| from keras.layers import Dense, Dropout, Input | |
| from keras.layers.merge import Add, Multiply | |
| from keras.optimizers import Adam |