Skip to content

Instantly share code, notes, and snippets.

View jasonyanwenl's full-sized avatar

Yanwen Lin jasonyanwenl

View GitHub Profile
def get_data(data_pack, data_request):
'''
Input: data_pack
data_request: It contains the following:
scope/context: the scope of the data, we want to return instances within this scope. meaningful scopes can often be sentences and documents
pairs of target_type and encoding_schemes/converters: list of target type and encoding scheme/converter, each encoding scheme can be a class (I simply wrote the function below).
Output: encoded data as tensors
Example:
data_request = [
@jasonyanwenl
jasonyanwenl / min-char-rnn.py
Created August 26, 2018 13:52 — 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)
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h2><center>Tutorial on Latent Dirichlet Allocation</center></h2>"
]
},
{