Skip to content

Instantly share code, notes, and snippets.

@Dexdev08
Dexdev08 / test_keras_two.py
Created June 24, 2017 14:58
test_keras_two.py
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import SGD
import keras as keras
import numpy as np
x_train = np.random.random((1000,20))
y_train = keras.utils.np_utils.to_categorical(np.random.randint(10, size=(1000,1)), nb_classes=10)
x_test = np.random.random((100,20))
y_test = keras.utils.np_utils.to_categorical(np.random.randint(10, size=(100,1)),nb_classes=10)
@Dexdev08
Dexdev08 / talk_python_similarities.py
Created June 7, 2016 13:46
Copy from local Ipython Notebook to derive similarity scores of Talk Python Transcripts
import graphlab as gl
import pandas
import numpy as np
import string
import re
import unicodedata
import math
# attempt to load text files
import os
files = os.listdir(os.getcwd())
@Dexdev08
Dexdev08 / talk_python_similarities.csv
Created June 5, 2016 14:36
Talk Python Cosine Similarity Scores
index file2 similarity file1
0 027.txt 0.870699976021 001.txt
1 038.txt 0.86203984054 001.txt
2 045.txt 0.83739929573 001.txt
3 048.txt 0.871940130115 001.txt
4 007.txt 0.839339858402 001.txt
5 009.txt 0.849677851534 001.txt
6 004.txt 0.830406980293 001.txt
7 006.txt 0.878178563493 001.txt
8 031.txt 0.850476330623 001.txt