コード例 #1
0
ファイル: hgcpp.py プロジェクト: werg/gcpp
def class_process_params(output_size = 1, weights = None, biases = None):
	input_size = len(cf['alphabet'])
	hidden_size = cf['init_hidden']
	size = hidden_size + output_size
	if weights is None:
		weights = np.mat(matnn.genentry((size,size+input_size)))
	if biases is None:
		biases = np.mat(matnn.genbias((size, 1)))

	return (output_size, weights, biases)
コード例 #2
0
ファイル: hgcpp.py プロジェクト: werg/gcpp
def gen_process_params(output_size = None, weights = None, biases = None, gen_input = None):
	if gen_input is None:
		gen_input = matnn.randomInput
	if output_size is None:
		output_size = len(cf['alphabet'])
	hidden_size = cf['init_hidden']
	size = hidden_size + output_size
	if weights is None:
		weights = np.mat(matnn.genentry((size,size+cf['gen_insize'])))
	if biases is None:
		biases = np.mat(matnn.genbias((size, 1)))
		
	return (output_size, weights, biases, gen_input)