Skip to content

Instantly share code, notes, and snippets.

View Dawny33's full-sized avatar

Jalem Raj Rohit Dawny33

View GitHub Profile
@Dawny33
Dawny33 / simple_mlp_tensorflow.py
Last active May 8, 2017 19:43 — forked from vinhkhuc/simple_mlp_tensorflow.py
Simple Feedforward Neural Network using TensorFlow
# Implementation of a simple MLP network with one hidden layer. Tested on the iris data set.
# Requires: numpy, sklearn>=0.18.1, tensorflow>=1.0
# NOTE: In order to make the code simple, we rewrite x * W_1 + b_1 = x' * W_1'
# where x' = [x | 1] and W_1' is the matrix W_1 appended with a new row with elements b_1's.
# Similarly, for h * W_2 + b_2
import tensorflow as tf
import numpy as np
from sklearn import datasets
from sklearn.model_selection import train_test_split
@Dawny33
Dawny33 / connect-ssh.py
Created March 10, 2017 12:53 — forked from diegopacheco/connect-ssh.py
Boto3 + Paramiko script to connect to a Box
import paramiko
k = paramiko.RSAKey.from_private_key_file("YOUR_PEM_FILE.pem")
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect( hostname = "ec2-1-1-1-1.us-west-2.compute.amazonaws.com", username = "ec2-user", pkey = k )
stdin , stdout, stderr = c.exec_command("hostname")
print("stdout: " + stdout.read())
print("stderr" + stderr.read())
@Dawny33
Dawny33 / Apriori.py
Created July 27, 2016 07:31 — forked from marcelcaraciolo/Apriori.py
Apriori.py
#-*- coding:utf-8 - *-
def load_dataset():
"Load the sample dataset."
return [[1, 3, 4], [2, 3, 5], [1, 2, 3, 5], [2, 5]]
def createC1(dataset):
"Create a list of candidate item sets of size one."