Skip to content

Instantly share code, notes, and snippets.

View felzek's full-sized avatar
🔒
Locked in

Yukon Peng felzek

🔒
Locked in
View GitHub Profile
@felzek
felzek / chat-frontend.js
Created September 18, 2019 21:25 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
import os
import urllib.request
import argparse
import sys
import alexnet
import cv2
import tensorflow as tf
import numpy as np
import caffe_classes
@felzek
felzek / AlexNet.py
Created July 10, 2018 07:33
AlexNet
class alexNet(object):
"""alexNet model"""
def __init__(self, x, keepPro, classNum, skip, modelPath = "bvlc_alexnet.npy"):
self.X = x
self.KEEPPRO = keepPro
self.CLASSNUM = classNum
self.SKIP = skip
self.MODELPATH = modelPath
#build CNN
self.buildCNN()
def maxPoolLayer(x, kHeight, kWidth, strideX, strideY, name, padding = "SAME"):
return tf.nn.max_pool(x, ksize = [1, kHeight, kWidth, 1],
strides = [1, strideX, strideY, 1], padding = padding, name = name)
def dropout(x, keepPro, name = None):
return tf.nn.dropout(x, keepPro, name)
def LRN(x, R, alpha, beta, name = None, bias = 1.0):
return tf.nn.local_response_normalization(x, depth_radius = R, alpha = alpha,