From 92f2acb2729359f063aab6b7d282e0e918a8d27c Mon Sep 17 00:00:00 2001 From: Lorenzo Torres Date: Thu, 16 Oct 2025 11:34:11 +0200 Subject: [PATCH] create parameter directories if not existent --- train.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/train.py b/train.py index 1bc0f6d..0efa836 100644 --- a/train.py +++ b/train.py @@ -1,6 +1,7 @@ import mlx.core as mx import numpy as np import math +import os # Functions shared by both the training and the testing scripts. from common import * @@ -186,6 +187,10 @@ for epoch in range(EPOCHS): LEARNING_RATE *= 0.99 print("\nTraining complete.") +if not os.path.exists("weights"): + os.makedirs("weights") +if not os.path.exists("biases"): + os.makedirs("biases") np.savetxt("weights/weights1.txt", np.array(W1)) np.savetxt("biases/biases1.txt", np.array(b1)) for i in range(HIDDEN_LAYERS):