Skip to content
Advertisement

Tag: pytorch

ML model not loading full batch

I tried to build a machine learning model using CIFAR 10 dataset, but I am encountering a bug that my model stops training past i = 78 (looped 78 times, see code for more). Sorry, I had to post the entire code because I cannot spot the mistake I made. Moreover, since I could not make it work, I tried

Initiaized class member in pytorch module

When declaring a model in pytorch, having a model class member variable declared and initialized mysteriously prevents it from being populated in the constructor. Is this expected? If so, why? Testing code below, with example models with a component member variable. The initialization value of the component (e.g. None, a number or a Tensor) does not change the behaviour. Answer

Specifying number of cells in LSTM layer in PyTorch

I don’t fully understand the LSTM layer in PyTorch. When I instantiate an LSTM layer how can I specify the number of LSTM cells inside the layer? My first thought was that it was the “num_layers” argument, if we assume that LSTM cells are connected vertically. But if that is the case how can we implement stacked LSTM with for

Advertisement