{{ message }}

Instantly share code, notes, and snippets.

🤖
Too much to do, too little time.

# Gaurav Menghani reddragon

🤖
Too much to do, too little time.
Created Mar 16, 2017
View reverse-nodes.cpp
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
 #include using namespace std; struct Node { int val; Node *next; }; void print(Node* n) {
Created Apr 5, 2017
Linear Regression in Python
View linear_regression.py
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
 ''' Linear Regression From First Principles Author: Gaurav Menghani (gaurav.menghani@gmail.com) ''' import numpy as np import matplotlib.pyplot as plt def linear_sum(X, W, b): return X.dot(W) + b
Created Apr 21, 2017
List of Possible Pet Projects
View pet-projects.md
1. embeddings.js: word2vec in Javascript
Created Apr 22, 2017
View mnist-pytorch.py
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 torch import torchvision import torch.nn as nn import torch.nn.functional as F import torchvision.transforms as transforms import matplotlib.pyplot as plt import numpy as np import torch.optim as optim from torch.autograd import Variable
Created Apr 30, 2017
Predicting whether there would be a goal in the next 20 steps in the ATARI Pong Game
View pong-next20-data.py
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 gym import logging import sys import numpy as np from gym import wrappers import torch import torchvision import torch.nn as nn import torch.nn.functional as F
Created May 8, 2017
CartPole for the OpenAI gym using Policy Gradients
View cart-pole-pg.py
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 gym import logging import sys import numpy as np from gym import wrappers import torch import torchvision import torch.nn as nn import torch.nn.functional as F
Created May 8, 2017
Slightly tweaked PG for CartPole #dogscience
View cart-pole-pg-v2.py
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 gym import logging import sys import numpy as np from gym import wrappers import torch import torchvision import torch.nn as nn import torch.nn.functional as F
Created May 29, 2017
Get all of those graduation pics
View script.py
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 os import sys import urllib2 def normalize_path(path): if path[-1] == '/': path = path[:-1] return path def get_dir_name(path):
Created Jun 11, 2017
Frozen Lake solved using the Q-Learning algorithm with an actual Q-value table
View frozen-lake-iterative.py
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 gym import logging import sys import numpy as np from gym import wrappers SEED = 0 NUM_EPISODES = 3000 # Hyperparams
Created Jun 12, 2017
Frozen Lake NN Implementation
View frozen-lake-nn.py
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 gym import logging import sys import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import cPickle as pickle import os