This file contains 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
import mxnet as mx | |
import numpy as np | |
## Example of Gumbel-softmax ## | |
## user settings | |
batch_size = 2 | |
cardinality = 3 | |
num_samples = 5 | |
temperature = 1.0 |
This file contains 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
#!/usr/bin/env python | |
import theano | |
import theano.tensor as T | |
import numpy as np | |
import sys | |
def create_ngram_data(input_file, ngram_size): | |
'''Reads input_file and returns a character ngram dataset |