Skip to content

Instantly share code, notes, and snippets.

View lanpa's full-sized avatar

Tzu-Wei Huang lanpa

View GitHub Profile
graph(%0 : Float(1, 3, 224, 224)
%1 : Float(64, 3, 11, 11)
%2 : Float(64)
%3 : Float(192, 64, 5, 5)
%4 : Float(192)
%5 : Float(384, 192, 3, 3)
%6 : Float(384)
%7 : Float(256, 384, 3, 3)
%8 : Float(256)
%9 : Float(256, 256, 3, 3)
graph(%0 : Float(1, 3, 224, 224)
%1 : Float(64, 3, 11, 11)
%2 : Float(64)
%3 : Float(192, 64, 5, 5)
%4 : Float(192)
%5 : Float(384, 192, 3, 3)
%6 : Float(384)
%7 : Float(256, 384, 3, 3)
%8 : Float(256)
%9 : Float(256, 256, 3, 3)
@lanpa
lanpa / alexnet.py
Created January 5, 2018 16:44
modified Alexnet
class AlexNet(nn.Module):
def __init__(self, num_classes=1000):
super(AlexNet, self).__init__()
self.features = nn.Sequential(
nn.Conv2d(3, 64, kernel_size=11, stride=4, padding=2),
nn.ReLU(inplace=True),
nn.MaxPool2d(kernel_size=3, stride=2),
nn.Conv2d(64, 192, kernel_size=5, padding=2),
nn.ReLU(inplace=True),
#!/usr/bin/env bash
set -e
######################################################################
# This script installs required dependencies for Torch7
######################################################################
{
install_openblas() {
# Get and build OpenBlas (Torch is much better with a decent Blas)
f = open('drinkquiz.txt', 'w')
char_remove = ['。\n。\n', '.\n.\n', '…\n…\n', '.\n.\n', '°\n°\n', '·\n·\n', '•\n•\n', '+\n+\n']
for i in range(2500):
for feed in feeds['data']:
if 'message' in feed:
msg = feed['message']
#print (msg)
for rm in char_remove:
msg = msg.replace(rm,'')
#print(msg)
@lanpa
lanpa / shop.py
Last active August 29, 2015 14:19
prices = {
"banana": 10,
"apple": 20,
"orange": 15,
"mango": 30
}
shopping_list1 = ["banana", "orange", "apple", "apple", "apple"]
shopping_list2 = ["banana", "orange", "apple", "banana", "apple"]
def sumThemAll(shoplist):
@lanpa
lanpa / gist:4427645
Last active December 10, 2015 11:28
%2013/1/1
%Tzu-Wei Huang
%demo of 'derivative of Gaussian', Difference of Gaussians and
%'Laplacian of Gaussian' in matlab.
close all;
[x,y] = meshgrid(-5:0.1:5,-5:0.1:5);
%gaussian with sigma = 1
z = (1/sqrt(2*pi))./exp((x.^2+y.^2)/2);