Skip to content

Instantly share code, notes, and snippets.

View halochou's full-sized avatar

halochou halochou

View GitHub Profile
@halochou
halochou / hack.sh
Created August 23, 2018 01:33 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@halochou
halochou / conv2dlocal.py
Created August 24, 2017 03:50
A PyTorch wrap for SpatialConvolutionLocal
import torch
from torch.autograd import Function
from torch._thnn import type2backend
from torch.nn.modules.utils import _pair
update_output_name = 'SpatialConvolutionLocal_updateOutput'
grad_input_name = 'SpatialConvolutionLocal_updateGradInput'
grad_params_name = 'SpatialConvolutionLocal_accGradParameters'
class Conv2dLocal(Function):
@halochou
halochou / conv_gru.py
Last active April 6, 2023 07:46
A simple implementation of Convolutional GRU cell in Pytorch
# Inspired by Alfredo Canziani (http://tinyurl.com/CortexNet/)
import torch
import torch.nn as nn
import torch.nn.functional as f
import torch.nn.init as init
from torch.autograd import Variable
class ConvGRUCell(nn.Module):
"""