So in my DataBlock I have this as my target:
CategoryBlock(vocab=vocab),
CategoryBlock(vocab=vocab)
The vocab
is simply 0 to 127 (length is 128)
All looks fine when I show_batch
and train … but when I call learn.predict
the output is not what I expected:
(('(#128) [0,1,1,0,1,1,0,1,0,1...]', '(#128) [0,0,0,1,1,2,0,1,0,0...]'),
tensor([[ 0.0350, 1.0502, 1.1848, 0.8337, 1.5485, 1.6603, 0.6151, 1.7123,
0.0395, 1.3813, 2.9159, 0.8222, 2.4387, 1.2496, 0.0395, -1.3586,
-0.6715, 3.2573, 1.4127, 1.8848, 1.3798, 2.2613, -2.5604, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264]]),
tensor([[ 0.0350, 1.0502, 1.1848, 0.8337, 1.5485, 1.6603, 0.6151, 1.7123,
0.0395, 1.3813, 2.9159, 0.8222, 2.4387, 1.2496, 0.0395, -1.3586,
-0.6715, 3.2573, 1.4127, 1.8848, 1.3798, 2.2613, -2.5604, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264,
-4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264, -4.2264]]))
Perhaps, “learn.predict” can’t be used when predicting two classes? If so, I assume I imply have to create a test_dl
and run it through learn.model()
? I’m using a custom loss function as well (so that might be it too)???
Anyways, any ideas/thoughts would be appreciated. Thanks!