nprnn.py
def sample_model(N):
	'''
	Samples the model, returns the sample of length N as a string
	'''
	ix = np.random.randint(0, VOCABULARY_SIZE)
	output = []
	output.append(index_to_char[ix])
	oh = [np.zeros((1, HIDDEN_LAYER_SIZE)) for i in xrange(DEPTH)]
	for c in xrange(N):
		oz, oh = forward(ix, oh)	
		result = np.random.choice(range(VOCABULARY_SIZE), p=oz.ravel())
		output.append(index_to_char[result])
		ix = result
	return ''.join(output).rstrip()

	Samples the model, returns the sample of length N as a string
	
Samples the model, returns the sample of length N as a string
Samples the model returns the sample of length N as a string
def sample_model(N):
	ix = np.random.randint(0, VOCABULARY_SIZE)
	output = []
	output.append(index_to_char[ix])
	oh = [np.zeros((1, HIDDEN_LAYER_SIZE)) for i in xrange(DEPTH)]
	for c in xrange(N):
		oz, oh = forward(ix, oh)	
		result = np.random.choice(range(VOCABULARY_SIZE), p=oz.ravel())
		output.append(index_to_char[result])
		ix = result
	return ''.join(output).rstrip()
def sample_model ( N ) : ix = np . random . randint ( 0 , VOCABULARY_SIZE ) output = [ ] output . append ( index_to_char [ ix ] ) oh = [ np . zeros ( ( 1 , HIDDEN_LAYER_SIZE ) ) for i in xrange ( DEPTH ) ] for c in xrange ( N ) : oz , oh = forward ( ix , oh ) result = np . random . choice ( range ( VOCABULARY_SIZE ) , p = oz . ravel ( ) ) output . append ( index_to_char [ result ] ) ix = result return '' . join ( output ) . rstrip ( )
Samples the model, returns the sample of length N as a string
Samples the model returns the sample of length N as a string
'''
	Samples the model, returns the sample of length N as a string
	'''
N