This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "<h2><center>Tutorial on Latent Dirichlet Allocation</center></h2>" | |
| ] | |
| }, | |
| { |