From 41d0a23830adbbf804c10b74e83bc01bd33c7da9 Mon Sep 17 00:00:00 2001 From: s444417 Date: Mon, 25 Apr 2022 22:55:03 +0200 Subject: [PATCH] add learn parameter --- runPythonScripts.sh | 2 +- src/trainScript.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/runPythonScripts.sh b/runPythonScripts.sh index 9e1106e..4d88b03 100644 --- a/runPythonScripts.sh +++ b/runPythonScripts.sh @@ -1,3 +1,3 @@ #!/bin/bash python3 ./src/task1python.py -python3 ./src/trainScript.py \ No newline at end of file +python3 ./src/trainScript.py 6 \ No newline at end of file diff --git a/src/trainScript.py b/src/trainScript.py index 05a2799..b873529 100644 --- a/src/trainScript.py +++ b/src/trainScript.py @@ -6,6 +6,9 @@ import numpy as np import tensorflow as tf from tensorflow.keras import layers +#train params +numberOfEpoch = sys.argv[1] + cwd = os.path.abspath(os.path.dirname(sys.argv[0])) pathTrain = cwd + "/../Participants_Data_HPP/Train.csv" @@ -56,7 +59,7 @@ linear_model.compile(loss = tf.losses.MeanSquaredError(), optimizer = tf.optimizers.Adam(1)) # train model -history = linear_model.fit(house_price_features, house_price_labels, epochs=5, ) +history = linear_model.fit(house_price_features, house_price_labels, epochs=numberOfEpoch, ) #callbacks=[cp_callback]) # print(history)