Skip to content

Instantly share code, notes, and snippets.

View Millsky's full-sized avatar
🌮
🌮

Kyle Mills Millsky

🌮
🌮
  • Vibrent Health
  • Fairfax VA
View GitHub Profile
@Millsky
Millsky / binarySearchTree
Created March 22, 2017 00:55
A binary search tree with insert - non self balancing
class node {
value: any
left: any
right: any
height: number
balanceFactor(){
var bf = (this.right.height) - (this.left.height);
}
constructor(v,h) {
'use strict';
class example_component extends HTMLElement {
/* THIS RETURNS THE NAME OF OUR WEB COMPONENT */
static get is() {
return 'v-graph'
}
/* WE CAN SET UP GETS TO RETRIEVE THE ELEMENT NAMES BAM, EASY ! */
import tensorflow as tf
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
x_learn = np.array([[1.000,2.000],
[10.000,2.0000],
[9.000,3.0000],
[5.000,8.000],
function convertToIntArray(hex){
var bytes = [],
str;
for(var i=0; i<hex.length-1;i+=2){
bytes.push(parseInt(hex.substr(i, 2), 16))
}
@Millsky
Millsky / perceptron.py
Last active April 3, 2016 16:09
A Implementation of a single perceptron that predicts the output of a linear function
import numpy as np
inputs = np.array([[1],[100],[3],[30],[40]])
testSet = np.array([[10],[13],[19],[33],[1]])
outputs = np.array([[5],[203],[9],[63],[83]])
bias = 1
biasWeight = 1
#initWeights
weights = np.random.random()
var curryAdd = (x) => (y) => return x + y;