aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/src/train.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/src/train.c b/src/lib/src/train.c
index 98f58ad..ccff553 100644
--- a/src/lib/src/train.c
+++ b/src/lib/src/train.c
@@ -216,12 +216,11 @@ void nnTrain(
216 216
217 // For now, we train with one sample at a time. 217 // For now, we train with one sample at a time.
218 for (int sample = 0; sample < inputs->rows; ++sample) { 218 for (int sample = 0; sample < inputs->rows; ++sample) {
219 // TODO: Introduce a BorrowMut.
220 // Slice the input and target matrices with the batch size. 219 // Slice the input and target matrices with the batch size.
221 // We are not mutating the inputs, but we need the cast to borrow. 220 // We are not mutating the inputs, but we need the cast to borrow.
222 nnMatrix training_inputs = 221 const nnMatrix training_inputs =
223 nnMatrixBorrowRows((nnMatrix*)inputs, sample, 1); 222 nnMatrixBorrowRows((nnMatrix*)inputs, sample, 1);
224 nnMatrix training_targets = 223 const nnMatrix training_targets =
225 nnMatrixBorrowRows((nnMatrix*)targets, sample, 1); 224 nnMatrixBorrowRows((nnMatrix*)targets, sample, 1);
226 225
227 // Will need the input transposed for backpropagation. 226 // Will need the input transposed for backpropagation.