Skip to content

1st Working Model Notes

KLi447 edited this page Apr 5, 2022 · 4 revisions

The model is an LSTM with 128 cells to a Dense layer with 2 outputs. The model tracks 4 metrics: training loss, training accuracy, validation loss, and validation accuracy. Loss is mean squared error and accuracy is mean absolute percentage error. The optimizer used is Adam because it's a good general-purpose optimizer.
image Input shape to the model is a tensor of shape (batch_size, 5, 2), where 5 corresponds to the number of timesteps and 2 corresponds to the latitude and longitude at the timestep. Output shape from the first layer is a tensor of shape (batch_size, 128), where 128 corresponds to the number of LSTM cells in the model. The final output shape from the model is a tensor of shape (batch_size, 2), where 2 is the latitude and longitude guess for the timestep after the input samples. For all layers, num_samples can be modified using the TensorFlow batch_size and will not affect model performance. The training label tensor is of shape (num_smaples, 2), where 2 is the ground truth latitude and longitude value for the timestep after the input sequence and is split into tensors of shape (batch_size, 2) to evaluate training and validation accuracy.
An example run of the model over 30 epochs is shown below (takes about 26ms per step, 43 steps per epoch):
Train loss:
image
Validation loss:
image
Training error:
image
Validation error:
image
Evaluating the model on larger dataset:
image
Preprocessing runs through dataset and finds sequences with time difference of 5 seconds (uniform timestep is needed for RNN to learn). Any sequence less than length 5 is ignored, and any sequences greated than length 5 is split into overlapping sequences of length 5.

Clone this wiki locally