preview

Lstm Lab Report

Better Essays

Following this change, the network can be fitted by LSTM. As can be seen from the below code snippet, the network has a visible layer with a single input, followed by four LSTM blocks/neuron in a hidden layer, and finally a single value prediction as result output layer. Moreover, default sigmoid activation function is applied to the LSTM blocks. Using the batch size of one, the network is then trained for 100 epochs. 1 look_back=1 2 # reshape input f o r the form [ samples , time¡steps , features ] 3 trnX = np . reshape ( trnX , ( trnX . shape [ 0 ] , 1 , trnX . shape [ 1 ] ) ) 4 tstX = np . reshape ( tstX , ( tstX . shape [ 0 ] , 1 , tstX . shape [ 1 ] ) ) 5 seq_mdl = Sqntl ( ) 6 seq_mdl . add (LSTM(4 , input_shape =(1 , look_back ) ) ) …show more content…

Now in the following chapters, data is generated from BSE and traders are trained and evaluated for BSE data. 22 3.3. LSTM RECURRENT NEURAL NETWORK Figure 3.3: LSTM Recurrent Neural Network epochs 23 CHAPTER 3. KERAS AND MODELS (a) (b) FIGURE 3.4. Models generated by Neural Networks : (a) MLP(left) and (b) CNN(right) 24 C H A P T E R 4 DATA USED 4.1 Bristol Stock Exchange BSE (Bristol Stock Exchange) is virtual financial exchange which is based on limit order book (LOB). It is developed in Python by Cliff[21] for teaching purposes and is less complicated than the real market financial-exchanges in various ways like although traders can issue a new order at any point of time in the limit order book, but they can only have single order at that time. Also as currently configured, zero latency is assumed by BSE in communications between the traders and the exchange. Moreover, if any transaction is performed by any trader (i.e., alteration in LOB by issuing an order), all other traders also receives an updated LOB before issuing any further orders (or any further transaction). 4.1.1 Traders in BSE BSE has various robot traders that may be as fundamental as the giveaway that may or may not makes the profit or as elaborate as ZIP, which generates profit. These traders found in BSE are discussed below. Giveaway: This robot

Get Access