Skip to content

Instantly share code, notes, and snippets.

@hushell
hushell / FGM.ipynb
Last active December 23, 2015 04:19
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hushell
hushell / min-char-rnn.py
Created March 11, 2016 23:51 — forked from karpathy/min-char-rnn.py
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)
@hushell
hushell / deform.py
Last active November 18, 2016 01:20
deform.py
import numpy as np
np.set_printoptions(precision=3)
# inputs
N = 2
E = 100
S = 0.5
nu = 0.2
A = np.array([[1,2,4],[4,3,1]])
xy = np.array([[0,0],[1,0],[0,1],[1,1]]) # coordinates [xi,yi]
@hushell
hushell / main.py
Last active November 26, 2018 19:42
svrg mnist
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import svrg_solver
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
function ww = approx_int_func_solve(xy_pairs, xmin, xmax, intval, w0, f, lbda)
% example:
% xy_pairs = [0, 1.32; 33.9, .55];
% xmin = 0;
% xmax = 33.9;
% intval = 38.985;
% w0 = [0.1,-2,2]
% ww = approx_int_func_solve(xy_pairs, xmin, xmax, intval, w0);
if nargin < 6
@hushell
hushell / plot_iou.ipynb
Created January 25, 2018 03:54
StageF -> Stage GD -> Stage F2 -> Stage FGD
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.