Contretemps

After yesterday’s little contretemps I finally managed to get that code running by using code from Deep Learning with PytTorch as a template. However there was practically no difference between my original code and the code from the book, so I still don’t know why it didn’t work yesterday.

However it is working now, and I might leave the rest of that book ’til later when I want to review other kinds of networks, such as RNNs, CNNs, LSTMs etc. For the moment I’ll just stick with plain old Feed Forward networks, aka Multi Layer Perceptrons. I did pick up some useful learning though, in relation to such things as batch processing, and also conversions between numpy arrays and torch tensors, which always seem to give me some trouble.

So, on to phase two of my study plan, which is to translate all the Tensorflow code in the Quantra courses into PyTorch code. Hopefully that will now be fairly straightforward. Happy, happy, joy, joy.

ETA: Have implemented the TF model in one of the chapters of the course as a PT model, and it worked well. Pretty easy really. There may be some nuances of the TF model that I didn’t catch, I have read that TF provides better fine-grained control of layers than PyTorch does. The TF model certainly performs better on the data, but my implementation was a bit simpler and I haven’t optimized it. Looks like I can move forward from here.

I did some more work on that model, adding a couple of extra features, and ended up with a model that predicted whether or not an equity would go up in the next 5 days better than 60% of the time. The equity was not trending either way over the period, just some ups and downs. Not too shabby!