Okay, I’ll try to work on it later too. Or maybe someone else will get to it.
I still didn’t get the ordering to work. I trust that your method works as you say. Do you see anything wrong with my code?
trn_iter,val_iter,test_iter = torchtext.data.BucketIterator.splits(splits, batch_sizes=(bs, bs, 1))
in my notebook:
md2 = TextData.from_splits(PATH, splits, 1) #setting all bs to 1, just for making predictions
m3 = md2.get_model(opt_fn, 1500, bptt, emb_sz=em_sz, n_hid=nh, n_layers=nl,
dropouti=dropouti, dropout=dropout, wdrop=wdrop,
m3.reg_fn = partial(seq2seq_reg, alpha=2, beta=1)
val_preds,y = m3.predict_with_targs()
res = np.argmax(val_preds,axis=1)