Skip to content

Instantly share code, notes, and snippets.

View suriyadeepan's full-sized avatar
🌱
Solving Hard Problems with Machine Learning

Suriyadeepan Ramamoorthy suriyadeepan

🌱
Solving Hard Problems with Machine Learning
View GitHub Profile
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
'''
N training examples (X,Y)
Y = f(X)
Y = f(X; theta)
def my_func(n):
for i in range(n):
print(i)
if __name__ == '__main__':
# call function here
my_func(10)
@suriyadeepan
suriyadeepan / rnn_hallucinations.c
Last active January 6, 2017 15:19
Language Modeling - RNN trianed on 3M lines of C code from the linux kernel source code
ixeof(mtd->pm, thdata->dst->hys_otg_dpage);
}
return ret;
}
void __u64 rv,
.str = 64;
}
list_mask |= ABLT_ATDR_PHY_SP5R,
[USB504X_MAAT1_B5,
\
@suriyadeepan
suriyadeepan / class_demo.py
Created January 6, 2017 08:32
Demonstration of class in python
# all classes are sub-classes/children of the ultimate parent class -> object (i think)
class Rectangle(object):
# the constructor
def __init__(self, length, breadth):
# class's properties
self.length = length
self.breadth = breadth
def area(self):
@suriyadeepan
suriyadeepan / rnn_madurai.txt
Created January 5, 2017 15:38
Text generated by 4-layer Stacked RNN, trained on Project Madurai
அத்தனையு மீடுவேன் புன்கழலிணைகொடுத்துயர்ந்து
பொய்கைப்புனை மரடும் புதுவையாய்
மாலுழல்
ஈறுஞ்சத் திருப்பாதங்கள் கருருவாய் என் றரு ளாய கிழகூடுதீடுசித்தன்னைக்கொண்டு விளங்க உனைக்காக்கொண்டு
தீட்ட படுஞ் தென்னன் எம்பெருமை
இடிமுனிசெயில் இணைபொருதரும்
அறுசீர் நுவனையன்
வானே புகழுக்கும் அளுவாய் ஆண்டுட்டு போங்கேவந்து
தேவ புலாவரும் அறுத்தாற்பொழுங்காதே
உலகீண்டுறும்
@suriyadeepan
suriyadeepan / sms_char_modeling_results.txt
Created January 5, 2017 04:17
Text generated by Character RNN trained on my personal sms data (mostly ads)
ஆ- 08/Moarter FLAT 30.330+20.
BUYB Talkse the Special TVCK & 24. in 110MB 35038.Fuald date incoming,
(Tollfree). Buy lowes.
Hi Call smy Limited so exttazi Gl Tin Coin- without fares starta kain of our 1
" Extra 25% atu.Get Lenses !!
Fly Sm, Preper muth the peditial Offer! Ge- 700+30% off, Vhop: Dede 77
@suriyadeepan
suriyadeepan / grid.js
Created January 4, 2017 03:04
"All work and no play makes Jack a dull boy" - Cellular Automata in p5.js
function Grid(cells, generation, cell_scale){
this.text = " all work and no play makes jack a dull boy ";
// cells
this.cells = cells;
this.generation = generation;
// scale
this.cell_scale = cell_scale;
// create next generation
this.next_gen = function(ruleset){
@suriyadeepan
suriyadeepan / ga_naive.py
Last active January 4, 2017 03:32
Happy New Year with a simple Genetic Algorithm
import numpy as np
import random
import sys
goal = 'All work and no play makes Jack a dull boy.'
idx2c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,. '
c2idx = { c : i for i,c in enumerate(idx2c) }
def encode(seq):
return np.array([c2idx[c] for c in seq ])
@suriyadeepan
suriyadeepan / cornell_corpus_results.py
Created December 31, 2016 01:13
Results of training seq2seq (1024x3_h - 8000 vocabulary) on Cornell Movie Dialog Corpus
'''
[1]
q : [will you unk your father and your queen]; a : [what about you]
q : [no doctor]; a : [but i dont know what it is]
q : [never heard from him again]; a : [not yet i dont know what he was talking about]
q : [you said something unk laying him to rest]; a : [we dont know what he was talking about]
q : [youre youre not doing what i think youre doing]; a : [im going to see you]
q : [well why didnt you list that among our assets in the first place what i wouldnt give for a unk cloak]; a : [but i dont think so]
@suriyadeepan
suriyadeepan / chatbot_1024_3layer_seq2seq.py
Created December 30, 2016 00:06
resutls of twitter chatbot
'''
########
# holy crap i'm excited about the results..
# i've been stuggling with this for a long time! :)
########
q : [they let me in the club im bouta pho it up]; a : [you dont even know what to do]
q : [manhattan ny congrats to unk and fellow jason leads unk seed in]; a : [thanks for the retweet ]
q : [making eye contact with may or may not be alive pls send help]; a : [is there on the field]