Skip to content

Instantly share code, notes, and snippets.

View chenyuntc's full-sized avatar
:octocat:

Yun Chen chenyuntc

:octocat:
View GitHub Profile
@chenyuntc
chenyuntc / dcgan.py
Created February 6, 2017 02:26 — forked from soumith/dcgan.py
import torch
import torch.nn as nn
import torch.nn.parallel
class DCGAN_D(nn.Container):
def __init__(self, isize, nz, nc, ndf, ngpu, n_extra_layers=0):
super(DCGAN_D, self).__init__()
self.ngpu = ngpu
assert isize % 16 == 0, "isize has to be a multiple of 16"
@chenyuntc
chenyuntc / min-char-rnn.py
Last active November 15, 2016 12:36 — 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)