Skip to content

Instantly share code, notes, and snippets.

View harshkn's full-sized avatar

Harsha K N harshkn

View GitHub Profile
@harshkn
harshkn / CircBuffer.c
Created April 8, 2011 09:26
C Implementation of simple circular buffer, Functionality provided are add to queue, read latest
typedef struct circular_buffer
{
void *buffer; // data buffer
void *buffer_end; // end of data buffer
size_t capacity; // maximum number of items in the buffer
size_t count; // number of items in the buffer
size_t sz; // size of each item in the buffer
void *head; // pointer to head
void *tail; // pointer to tail
} circular_buffer;
@agramfort
agramfort / demo_adaptive_lasso.py
Created January 14, 2012 10:35
Adaptive Lasso demo
"""Example of adaptive Lasso to produce event sparser solutions
Adaptive lasso consists in computing many Lasso with feature
reweighting. It's also known as iterated L1.
"""
# Authors: Alexandre Gramfort <[email protected]>
#
# License: BSD (3-clause)
import numpy as np
@samwhitehall
samwhitehall / glasso.m
Created September 3, 2013 11:23
graphical lasso (w/shooting algorithm) in Matlab
function [Theta] = glasso(S,rho)
[n,p] = size(S);
max_iterations = 100;
t = 1e-4;
convergence_value = t * meanabs(S - diag(diag(S)));
% initialise
W_old = S + rho*eye(p);
W = W_old;
{
"settings": {
"icons" : true
},
"firstname": "Prateek",
"familyname": "Agarwal",
"linkedin_id": "prat0318",
"github_id": "prat0318",
"bio_data": {
"email": "prat0318 @ cs.utexas.edu",
@takuma7
takuma7 / opencv-fourcc-on-mac-os-x.md
Last active April 3, 2024 07:29
OpenCV Video Writer on Mac OS X
@Newmu
Newmu / simple_gan.py
Created July 10, 2015 20:39
Simple Generative Adversarial Network Demo
import os
import numpy as np
from matplotlib import pyplot as plt
from time import time
from foxhound import activations
from foxhound import updates
from foxhound import inits
from foxhound.theano_utils import floatX, sharedX
@karpathy
karpathy / min-char-rnn.py
Last active November 16, 2024 07:19
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@bishboria
bishboria / springer-free-maths-books.md
Last active October 3, 2024 09:17
Springer made a bunch of books available for free, these were the direct links
@danielrw7
danielrw7 / replify
Last active November 7, 2024 02:47
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for `%s`\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "%s> " "$command"

How to install dlib v19.9 or newer (w/ python bindings) from github on macOS and Ubuntu

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
  • On Linux: