Skip to content

Instantly share code, notes, and snippets.

View llSourcell's full-sized avatar

Siraj Raval llSourcell

View GitHub Profile
#Step 1 - clone universe
#git clone https://github.com/openai/universe.git
#cd universe
#pip install -e . (Editable mode) It makes installed packages editable.
#And its reading which packages to download from setup.py
#Step 2 - install command line tools
#Step 3 - Install 3 more packages. Homebrew is like apt-get for OS X.
index area bathrooms price sq_price
0 2104.0 3.0 399900.0 190.066539924
1 1600.0 3.0 329900.0 206.1875
2 2400.0 3.0 369000.0 153.75
3 1416.0 2.0 232000.0 163.84180791
4 3000.0 4.0 539900.0 179.966666667
5 1985.0 4.0 299900.0 151.083123426
6 1534.0 3.0 314900.0 205.280312907
7 1427.0 3.0 198999.0 139.452697968
8 1380.0 3.0 212000.0 153.623188406
#easier
https://github.com/bhaktipriya/Blues
##Explain what he did, why we need better music
modules in python
#1 first tried a simple RNN with 2 LSTM layers
#2 88 binary classification problem
#3 multiclass classification, (two at same time)
sigmoid cross entropy instead of softmax
#4 Music is complex.
//Define 10x20 grid as the board
var grid = [
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
import numpy as np
# input data
X = np.array([ [0,0,1],
[0,1,1],
[1,0,1],
[1,1,1] ])
# output labels
y = np.array([[0,0,1,1]]).T
while norm > epsilon:
iteration += 1
norm = dist_method(prototypes, prototypes_old)
prototypes_old = prototypes
#for each instance in the dataset
for index_instance, instance in enumerate(dataset):
#define a distance vector of size k
dist_vec = np.zeros((k, 1))
#for each centroid
for index_prototype, prototype in enumerate(prototypes):
#first we feed the input image into a convolutional layer to get a feature map
h = self.cnn_layer(X, layer_i=0, border_mode="full") ; X = h
#then we acivate it with a nonlinearity to make sure the math doesn't break (turn all neg numbers to 0)
h = self.relu_layer(X) ; X = h
#another CNN layer for more, smaller images (more hierarchical features = better prediction)
h = self.cnn_layer(X, layer_i=2, border_mode="valid") ; X = h
#another nonlinearity
h = self.relu_layer(X) ; X = h
#pooling to reduce computational cost, extract the most important features
h = self.maxpooling_layer(X) ; X = h
pragma solidity ^0.4.4;
contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
Number Target
1 0
2 1
3 0
4 1
5 0
6 1
... ...
99 0
100 1
import tweepy
import praw
import coindesk
import dict_list
import pandas as pd
import word2vec as w2v
#Step 1 - Retrieve Tweets past 30 days
twitter_config = json.load(TWEEPY_CONFIG_FILE)