From 681118c9d2bd75933e1fb8cd02ed607e6b02a7ab Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 27 Dec 2023 18:15:34 +0100 Subject: [PATCH] Fix logic in MLPPSoftmaxReg. --- mlpp/softmax_reg/softmax_reg.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mlpp/softmax_reg/softmax_reg.cpp b/mlpp/softmax_reg/softmax_reg.cpp index 3d70672..2e206e3 100644 --- a/mlpp/softmax_reg/softmax_reg.cpp +++ b/mlpp/softmax_reg/softmax_reg.cpp @@ -273,7 +273,7 @@ bool MLPPSoftmaxReg::needs_init() const { int k = _input_set->size().x; int n_class = _output_set->size().x; - if (_y_hat->size().x != n) { + if (_y_hat->size().y != n) { return true; } @@ -294,7 +294,7 @@ void MLPPSoftmaxReg::initialize() { int k = _input_set->size().x; int n_class = _output_set->size().x; - _y_hat->resize(Size2i(n, 0)); + _y_hat->resize(Size2i(0, n)); MLPPUtilities util; @@ -315,6 +315,8 @@ MLPPSoftmaxReg::MLPPSoftmaxReg(const Ref &p_input_set, const Ref