Skip to content

Instantly share code, notes, and snippets.

View autosquid's full-sized avatar

mightu autosquid

  • HangZhou, ZheJiang, China.
View GitHub Profile
@santi-pdp
santi-pdp / Generative Adversarial Networks toy example.ipynb
Created February 16, 2017 18:36
A toy example on Generative Adversarial Networks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@autosquid
autosquid / bow+svm+2class.py
Created May 10, 2016 09:17
Bow + SVM for front/back face determination
"""BoW on SIFT"""
import changetoworkingdir #changes to working dir.
import os
import hammer
import pongeecore as pc
import cv2
import numpy as np
import random
import matplotlib
@samueljohn
samueljohn / samuels_python3_setup.md
Last active January 3, 2020 19:29
For my own reference. Brewed Python3, numpy, scipy and the rest goes in a pyvenv.

Samuel's Python3 setup for Mac:

This document describes in which way, what packages, and from where are installed on my Macs to get a decent Python 3.x, scipy/numpy & Co setup.

Note, I switched to Python's 3.x pyvenv from virtualenv in order to handle my pip-installable packages. Also thanks to Anaconda, the whole setup is so simple now that I use this document just to remember which additional packages I like.


@haf
haf / LICENSE
Last active February 14, 2024 11:15
Setting up a digitalocean proxy
https://www.gnu.org/licenses/gpl-3.0.en.html
GNU GENERAL PUBLIC LICENSE v3
@neubig
neubig / lstm-lm.py
Last active August 23, 2017 09:18
This is a minimal implementation of training for a language model using long short-term memory (LSTM) neural networks
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is a simplified implementation of the LSTM language model (by Graham Neubig)
#
# LSTM Neural Networks for Language Modeling
# Martin Sundermeyer, Ralf Schlüter, Hermann Ney
# InterSpeech 2012
#
# The structure of the model is extremely simple. At every time step we
@jdeng
jdeng / cluster
Last active June 17, 2020 02:52
clustering by fast search and find of density peak
// generate [0..n-1]
auto seq = [](size_t n) -> std::vector<size_t> {
std::vector<size_t> v(n);
for (size_t i=0; i<n; ++i) v[i] = i;
return v;
};
auto index = seq(n);
// n * n distance matrix
std::vector<D> dists(n * n);
@jamiecurran
jamiecurran / gist:8271908
Last active January 2, 2016 07:48
ipad mini ffmpeg
ffmpeg -i 00091.MTS -r 30 -strict -2 -async 1 -acodec aac -ac 2 -ab 160k -threads 0 -preset slower -profile:v high -level 4.1 -f mp4 -refs 4 ~/videos/conversions/00091.mp4
@jdeng
jdeng / seq.hh
Created December 12, 2013 19:24
integer sequence c++ 11
//copied from http://stackoverflow.com/questions/17424477/implementation-c14-make-integer-sequence
template<int...> struct seq { using type = seq; };
template<typename T1, typename T2> struct concat;
template<int... I1, int... I2> struct concat<seq<I1...>, seq<I2...>>: seq<I1..., (sizeof...(I1) + I2)...> {};
template<int N> struct gen_seq;
template<int N> struct gen_seq: concat<typename gen_seq<N/2>::type, typename gen_seq<N-N/2>::type>::type {};
template <> struct gen_seq<0>: seq<>{};
template <> struct gen_seq<1>: seq<0>{};
# Installing OpenCV python libs on mac to work with virtualenv
# OpenCV 2.4.3
# Python 2.7.3 installed with brew
# assuming you have virtualenv, pip, and python installed via brew
# assuming $WORKON_HOME is set to something like ~/.virtualenvs
# using homebrew - make sure we're current
brew update
@heiths
heiths / mayaOnUbuntu.sh
Last active February 28, 2024 18:50
Shell script to install and setup Autodesk Maya 2014 on Ubuntu 13.04
#!/bin/bash
#Heith Seewald 2012
#Feel free to extend/modify to meet your needs.
#Maya on Ubuntu v.1
#This is the base installer... I’ll add more features in later versions.
#if you have any issues, feel free email me at heiths@gmail.com
#### Lets run a few checks to make sure things work as expected.
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then