INNER CODE UNIT · Python

sec

adminho/trading-stock-thailand · LSTM_predict_trend.py:76

	sec = datetime.timedelta(seconds=int(time.time() - start))			  
	print ("Compilation Time : ", str(sec))	
	return model

def trainModel(symbolName, Xtrain, Ytrain, Xtest, Ytest, epochs):
	history = his.TrainingHistory()
	h5_file = os.path.join(MODEL_PATH,'%s_weights.h5' % (symbolName))
	json_file = os.path.join(MODEL_PATH,'%s_structure.json' % (symbolName))
	
	global_start_time = time.time()	
	# Shape: example number, sequence lenght, feature number
	model = buildModel(Xtrain.shape, h5_file)
		
	# Learning	
	#model.fit(Xtrain, Ytrain, batch_size=500, nb_epoch=epochs, verbose=2, validation_split=0.05 )
	print('Wait training ... ')
	model.fit(Xtrain, Ytrain, batch_size=500, 
				nb_epoch=epochs, 

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…