Skip to content

Instantly share code, notes, and snippets.

View harshkn's full-sized avatar

Harsha K N harshkn

View GitHub Profile
@karpathy
karpathy / min-char-rnn.py
Last active July 10, 2025 01:16
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)
@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
@takuma7
takuma7 / opencv-fourcc-on-mac-os-x.md
Last active December 29, 2024 19:56
OpenCV Video Writer on Mac OS X
{
"settings": {
"icons" : true
},
"firstname": "Prateek",
"familyname": "Agarwal",
"linkedin_id": "prat0318",
"github_id": "prat0318",
"bio_data": {
"email": "prat0318 @ cs.utexas.edu",
@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;
@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
@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;