Hello! I have a question concerning online learning with pyTorch. Usually, samples are supplied to networks as a list. In online learning, in contrast, training and prediction uses single samples at a time.
With feed forward networks you can simply set a batch size of one and supply the network with a data set consisting of only one sample. With a recurrent network, however, I need to keep the activation of the recurrent neurons for the next incoming sample.
The pseudocode below illustrates what I want to do with a time series iterator that consists of individual samples.
input_value = 0.
while True:
  target_value = time_series.next()
  output_value = network.train(input_value, target_value)
  error = output_value - target_value
  input_value = target_value

I got the impression pyTorch might be appropriate to achieve this with minimal invasion. In every example I found, however, the samples were provided in one big data set.
Can you do this reasonably easy with pyTorch? A code example would be highly appreciated. Thanks a lot!