In this video, we'll be looking at how to use Arnon's for human activity recognition, since you've
seen most of this code before, the majority of this lecture will focus on how to build the Arnim and
also to look at the results.
So if you have not yet seen how to pass the data files, please go to the lectures where that was done.
As usual, we'll be testing two different models, one that only uses the Time series and one that combines
the Time series with static features.
OK, so let's start with the imports.
You'll notice that I've decided again to use the ASTM.
However, you're encouraged to try other RPN units as well, including the GIU and even the simple in.
The next step is to download the data.
The next step is to unzip the zip file we just downloaded.
The next step is to set a few constants, including the sequence length number of samples, a number
of dimensions and number of classes.
The next step is to define our data loading function, as you recall, this loads in the Times series
files and converts them into arrays of size NBT videos for both train and test.
Since I've explained this function before, I won't do so again.
The next step is to call a function to get X train, Y train, X test and Y test.
The next step is to plot one of the multivariate time series samples, so you remember what they look
like.
The next step is to create our LSM Arnon, so you can see that I've decided to set return sequences
equal to true and to use global max pooling.
I've also commented out one extra calcium layer to remind you that you can add however many you choose.
As always, please test different configurations and check the results if you're curious about how they
will perform.
The next step is to call, compile and fit, as we normally do.
The next step is to plot the laws per epoch.
So the last report looks OK.
The next step is to check the accuracy prepack.
So the accuracy looks OK, but note that it seems quite low compared to the other models we've seen.
The next step is to load in our best model and check the accuracy on our test said.
OK, so our model only achieves about 90 percent, so this confirms our suspicions that the Arnim underperforms
compared to the other models we've studied.
The next step is to write a function that will load in the tabular features, since I've explained this
code before, I won't explain it again.
The next step is to load in our tabular features.
The next step is to create our combined aren't in, so we start by creating an A-list demand that ends
with global max pooling.
As per usual, as you recall, this ends up with a single feature vector.
The next step is to create our anend branch for the tabular features.
Note that this also gives us a single feature vector.
The next step is to combine the two feature vectors together and then pass the results through the final
dance layer.
The next step is to call Plott model.
So as you can see, our model consists of two input branches which then merge into a single branch to
give us one final prediction.
The next step is to call, compile and fit once again.
The next step is to plot the laws prepack.
So the last report looks OK.
The next step is to plot the accuracy prepack.
So the accuracy looks OK.
Better than before, but it still doesn't outperform the previous models we've seen.
The next step is to load up our best model and check how it performs on the test, said.
So as you can see, while the test accuracy does improve with the features, it still fails to achieve
the results we saw before.