Yr12 Journal 16

In Term 3 Week 3, I was thinking about what is the best way to implement the User Interface for my project.

Progress

I made some research and I have considered a few ways to implement my project:

  • Website

    • Use Websocket for long connection so that the website can fetch the prediction result in real-time
  • GUI Application

    • Just like what I did for my previous project, using QT to render a GUI
  • CLI

    • Full command line GUI, this is really cool as it looks like a hacker tool when people use this

In the meantime, I also reviewed my understanding of the MLP and the reason I made a Sequential Model with 3 layers (as mentioned from the last blog post).

MLP Process

Just like how human brain process information and gives output, MLP is implementing the same concept.

A most fundimental structure of artificial neural network would be something called Perceptron.

perceptron

MLP basically calculates weights for each input and combine them and use the sum to implement step function, most commonly Heaviside step function, or sometimes use sign function (sgn):

fn

Since the weights are calculated, the neural network will be able to “learn” about the relationship between input and outputs i.e. by using regression (this gives a linear model).

My project

In my project I have 3 layers for my MLP model: input layer, hidden layer, and output layer. This is a pretty straighforward model as I only need to find out the linear relationship between multiple variables and the output price. Therefore I chose to use a Sequential Model as it basically calculates the linear relationship.

model

  • Input Layer (Shape[16,], 128 neurons)

This layer has all the input data I had relating to the crypto trades, i.e. open time, trade amounts, close price, etc. Hence, when the model is trained, I can make prediction using these inputs.

The shape of the layer has width 16, this indicates there are 16 inputs. 128 neurons will used to calculate the weight as it will connect the input to the neurons to form a weighting matrix for calculation.

  • Hidden Layer (16 neurons)

To let the model can train the data accurately, backpropagation is essential. Basically the model will predict values using forward propogation, then it will calculate the error (in this case I used Mean Absolute Error, Mean Square Error). Then it will save the foward propagation result to the hidden layer. Backpropagation uses the hidden layer to make a reversed process and to adjust the weights.

Basically each epoch sends calculation of the input layer to hidden layer, then backpropagation calculates reversly via the hidden layer, finally it adjusts parameters (i.e. weights), and this process continues until an accurate relationship has been discovered.

As I have a lack of computing power, I have 16 neurons in the hidden layer, this means the weighting calculated from the input layer will be analysed into 16 neurons (for foward propagation and back propagation). The more number here the longer it takes to calculate. 16 is not too less and not too much, and it can train the model quickly.

  • Output Layer (1 neuron)

As we want to output prediciton prices, therefore 1 neuron is enough, and the predicted value of price will be tranfered to this layer and will become the output of the model’s predicition value.

Challenges

There is no challenge this week as most things I did is to research and analyse

Reflection

  • I came up with 3 solutions to implement the GUI of my project
  • I studied about the Neural Network and the MLP (80% confidence of understanding the basic knowledge of the linear models)
  • I explained the reason I designed my model

Timeline

I am on track, and still beyond my original timeline, in this two weeks I will finish the GUI implementation, then I will start testing.