Skip to content

Instantly share code, notes, and snippets.

View alanderex's full-sized avatar

Alexander CS Hendorf alanderex

View GitHub Profile
@alanderex
alanderex / finetune.py
Created June 28, 2018 22:19 — forked from panovr/finetune.py
Fine-tuning pre-trained models with PyTorch
import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
@alanderex
alanderex / min-char-rnn.py
Created April 7, 2018 12:14 — 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)
// assuming the latest vcersion 3.2 for this solution <3.2 difers
// prerequisites: all docs contain both fields
// In the real world, I'd add a search with $exists as well and check for the data type $type: 2
// plus double check the format matches MM/DD/YYYY
function makeToDate(d) {
var thedate = new Date(d);
return thedate
}