NN_calibration
NN_calibration copied to clipboard
What should the final shapes be for calibration?
It's not entirely clear to me what's going on in the cal_results
function.
My classifications are of shape (n_samples, n_timesteps, n_classes), which is turned into a 1D array of shape (n_samples, ) by doing argmax on axis -1, which then passes all comparisons between y_true and y_pred.
But the logits are pickled as they are, which leads to a value error in cal_results
, when calling model.fit()
.
I'm not sure I understand correctly. Should they be simply be unravelled, such that
[531, 21, 5, 681, ...] is compared to [1, 0, 0, 1]? Do I need to argmax the logits first? Because then the calibration fit spits out ValueError: X should be a 1d array
.
But if I unravel it, softmax()
throws a numpy.AxisError: axis 1 is out of bounds for array of dimension 1
.
So which dimensionality is correct?
Hey,
sorry for the late response.
I am not sure if it is the issue, but the pickled logits file ((logits_val, y_val), (logits_test, y_test)) should contain the following:
-
logits_val
( n_val_samples, n_classes) -
y_val
(n_val_samples) -
logits_test
(n_test_samples, n_classes) -
y_test
(n_test_samples)
Let me know if You have some more questions.